给出以下示例
iris_fat <- iris %>% mutate(is_fat = factor(ifelse(Sepal.Width * Petal.Width > 6 ,"fat", "not_fat")))
reg <- lm(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width + is_fat, data = iris_fat)
GGally::ggcoef(reg)

如何将术语is_fatnot_fat的名称更改为其他名称。
发布于 2018-03-13 21:58:03
我对之前的评论不太满意,没有仔细阅读。
ggcoef会创建一个列表,就像其他的ggplot函数一样。第一个元素,即数据,是term映射到y轴的数据.如果你很好奇,试试str(test_plot$data)或者用RStudio来检查它
test_plot <- ggcoef(reg)
test_plot$data$term <- c("(Intercept)", "is_fat", "Petal.Length", "Petal.Width", "Sepal.Width")https://stackoverflow.com/questions/49265917
复制相似问题