Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SummarySE()函数抛出错误:Can';t重命名不带';不存在。x列'len'不';不存在_R_Ggplot2_Errorbar - Fatal编程技术网

SummarySE()函数抛出错误:Can';t重命名不带';不存在。x列'len'不';不存在

SummarySE()函数抛出错误:Can';t重命名不带';不存在。x列'len'不';不存在,r,ggplot2,errorbar,R,Ggplot2,Errorbar,我的R版本是3.6.0。我试图使用此处定义的summarySE()创建错误条: 我以前曾多次使用此函数绘制错误条。但是,当我尝试在更新R之后运行函数时,我得到了以下错误 Error: Can't rename columns that don't exist. x The column `value` doesn't exist. 我试着在网站上运行示例代码(见下文),但得到了相同的错误 tg <- ToothGrowth head(tg) tgc <- summarySE(tg

我的R版本是3.6.0。我试图使用此处定义的summarySE()创建错误条:

我以前曾多次使用此函数绘制错误条。但是,当我尝试在更新R之后运行函数时,我得到了以下错误

 Error: Can't rename columns that don't exist.
x The column `value` doesn't exist.
我试着在网站上运行示例代码(见下文),但得到了相同的错误

tg <- ToothGrowth
head(tg)
tgc <- summarySE(tg, measurevar="len", groupvars=c("supp","dose"))
head(tgc)

tg所以当我安装summarySE()所属的Rmisc包时,示例代码实际运行。在我的代码中,我使用dplyr和plyr。我认为一定有冲突,因为当我运行自己的代码时,我会得到相同的错误。冲突来自于加载plyr和dplyr。。因此,如果您不加载任何一个包,只运行上面的函数,它就可以工作。在Rmisc包中,他们可能会专门调用该函数来防止冲突。值得注意的是,这本食谱的作者:)我也遇到了同样的问题,而且它令人难以置信地混乱。我显式加载dplyr,但plyr必须是我正在加载的其他包的依赖项。我试着用conflicted来处理这个问题。冲突的首选(“重命名”、“dplyr”)失败,但冲突的首选(“重命名”、“plyr”)有效。如果烹饪书的作者能够在他们的代码中明确这一点,那就太好了。