我想coefplot.glm()
用定制的系数名称绘制一个。
考虑以下代码:
coefplot::coefplot.glm(lm(rbinom(1000,1,.5) ~ rnorm(1000,50,2) + rbinom(1000,1,prob=0.63) + rpois(1000, 2)))
这很好用,但给了我原来的变量名;我想在coefplot.glm()
调用中将它们更改为c("x1", "x2", "x3", "Intercept")
. [我实际上正在处理分解数据并且重命名它并不是很容易 - 重命名将是另一个导入的向量]
我试过
coefplot::coefplot.glm(lm(rbinom(1000,1,.5) ~ rnorm(1000,50,2) + rbinom(1000,1,prob=0.63) + rpois(1000, 2)),
newNames = c("1", "2", "3", "Interc"))
但这会产生
mapvalues(x, from = names(replace), to = replace, warn_missing = warn_missing) 错误:
from
向量to
长度不同。