ggplot2 相关问题

ggplot2是一个积极维护的R开源图表绘图包,由Hadley Wickham编写,基于“图形语法”的原则。它部分取代了R的基本图和格子包,同时提供了一个干净,强大,正交和有趣的API。

如何正确地将线路与ggplot2图中的点连接在一起? 我正在尝试使用r中的ggplot2创建一个散点图,其中每个点都由其组中的一条线连接。数据代表影响各种结果的不同条件,每个条件...

# Sample data set.seed(123) example_data <- data.frame( condition = rep(c("Condition A", "Condition B", "Condition C"), each = 3), outcome = rep(c("Outcome 1", "Outcome 2", "Outcome 3"), 3), estimate = runif(9, -2, 2), error = runif(9, 0.5, 1.5) ) example_data$lower <- example_data$estimate - example_data$error example_data$upper <- example_data$estimate + example_data$error # Attempt to plot library(ggplot2) ggplot(example_data, aes(x = estimate, y = outcome, group = interaction(condition, outcome), color = condition)) + geom_point(position = position_dodge(width = 0.5), size = 3) + geom_line(aes(group = condition), position = position_dodge(width = 0.5)) + geom_errorbar(aes(xmin = lower, xmax = upper), width = 0.1, position = position_dodge(width = 0.5)) + theme_minimal() + labs(title = "Effect of Different Conditions on Various Outcomes", x = "Coefficient Estimate", y = "Outcome") + scale_color_manual(values = hcl.colors(3, "Berlin"))

回答 1 投票 0



使用ggplot(x轴中正确的顺序)

我使用GGPLOT遇到了一些问题。在我的脚本的同一部分中的某个时候,我遵循以下问题:

回答 1 投票 0

根据因子

...... 我有一个看起来像这样的数据框架: # A tibble: 6 × 8 N S DG P locus replicate MLE_s_BwS MLE_s_WF <int> <dbl> <int> <int> <int> <int> <dbl> <dbl> 1 100 0 1 1 0 0 -0.174 -0.183 2 100 0 1 1 1 0 0.143 0.143 3 100 0 1 1 2 0 -0.0758 -0.0758 4 100 0.1 10 1 3 0 -0.141 -0.141 5 100 0.1 10 1 4 0 0.102 0.102 6 100 0.1 10 1 5 0 0.102 0.102

回答 1 投票 0


我不能突然加载ggplot2

我尝试了堆栈流的所有建议,涉及类似问题。我删除并重新安装了Rlang和GGPLOT2,甚至还重新安装了计算机上的整个R-Studio。 我仍然得到...

回答 1 投票 0

颜色在ggplot2

R2> = 0.8红

回答 1 投票 0


GGPLOT基于predivions(),get_datagrid()和get_predicated()函数

我有此数据:<- efc %> <- datawizard::to_factor(efc, c("c161sex", &...

回答 1 投票 0



ggplot中的打印文本

我的代码: ggplot(datas,aes(x = property_name,y = val_int,fill = property_name)) + GEOM_BOXPLOT()+YLIM(0,4.5)+ stat_summary(fun.y =均值,color =“ darkred”,geom =“ poin ...

回答 1 投票 0

回答 1 投票 0

播放传说未显示或在r

给出了一个较小的模拟数据集,可轻松可重复性

回答 1 投票 0

使用ggplot和ggeffect

<-efc %> 我有这个数据<- datawiz...

回答 1 投票 0

如何在ggplot

在生物医学研究中,进行一个实验,其中一个疾病变化(例如,小鼠或细胞系的基因型,用各种药物治疗)并测量单个主要的

回答 4 投票 0

如何在rstudio中进行交互编辑r图?

是有一个包或功能,可以让我直接在rstudio中编辑图?

回答 1 投票 0


为什么使用组并填充GGPLOT2会产生意外的箱形图?

这是我的数据: A1<- c(1,2,9,6,4) A2 <- c(5,1,9,2,3) A3 <- c(1,2,3,4,5) B1 <- c(2,4,6,8,10) B2 <- c(0,3,6,9,12) B3 <- c(1,1,2,8,7) DF2 <- data.frame( x = c(c...

回答 2 投票 0

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.