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