r - “条件”列不存在。即使该列显然存在?
问题描述
我有以下公式:
ANOVAtest <- anova_test(data=Dataovershootwithoutmeans, formula=overshoot~Condition*Distancetodistalboundary+Error(ID/Condition*Distancetodistalboundary), dv=overshoot, wid=ID,within=c(Condition,Distancetodistalboundary),effect.size = "pes")
错误:不能对不存在的列进行子集化。x 该列Condition
不存在。运行rlang::last_error()
以查看错误发生的位置。
即使我可以在我的数据框中清楚地看到有一个名为“条件”的列!
任何人都可以伸出援助之手吗?
可重现的数据集:
library(rstatix)
ANOVAtest <- anova_test(data=Dataovershootwithoutmeans, formula=Stopdistancefromstart~Condition*Distancetodistalboundary+Error(ID/Condition*Distancetodistalboundary), dv=Stopdistancefromstart, wid=ID,within=c(Condition,Distancetodistalboundary),effect.size = "pes")
structure(list(Distancetodistalboundary = c(77.008, 77.008, 77.008,
108.61, 108.61, 108.61, 156.016, 156.016, 156.016, 227.123, 227.123,
333.784, 333.784, 77.008, 77.008, 77.008, 108.61, 108.61, 108.61,
156.016), Condition = c("0", "0.5", "2", "0", "0.5", "2", "0",
"0.5", "2", "0", "0.5", "0", "0.5", "0", "0.5", "2", "0", "0.5",
"2", "0.5"), ID = c("P_200214123342", "P_200214123342", "P_200214123342",
"P_200214123342", "P_200214123342", "P_200214123342", "P_200214123342",
"P_200214123342", "P_200214123342", "P_200214123342", "P_200214123342",
"P_200214123342", "P_200214123342", "P_200217101213", "P_200217101213",
"P_200217101213", "P_200217101213", "P_200217101213", "P_200217101213",
"P_200217101213"), Stopdistancefromstart = c(80.21, 98.661, 98.4568,
114.916, 132.014666666667, 114.558, 175.139, 173.9455, 216.5585,
245.408, 263.881, 360.428, 491.432, 81.4215, 83.917, 91.191,
116.674, 158.305, 116.279, 176.845), overshoot = c(3.202, 21.653,
21.4488, 6.306, 23.4046666666667, 5.94800000000001, 19.123, 17.9295,
60.5425, 18.285, 36.758, 26.644, 157.648, 4.41350000000001, 6.90900000000001, 14.183, 8.06400000000001, 49.695, 7.669, 20.829)), row.names = c(NA, -20L), class = c("tbl_df", "tbl", "data.frame"))
解决方案
推荐阅读
- c - 数组 c 中的偶数和正数元素
- javascript - 从对象 javascript/typescript 数组更改属性名称
- javascript - 无法在 onEdit 函数中重新分配全局变量
- javascript - javascript 样式仅在使用 setTimeout 时应用于元素
- reactjs - 如何让我的 Ionic-React 应用程序停止更改 tsconfig.json 覆盖“JSX”类型?
- python - 为什么我在管理面板中创建的 Post 模型没有显示在管理面板中?
- javascript - 未捕获的类型错误:无法读取 chrome 未注册的 null 属性“classList”(试图显示和消失标题)
- python - 以 Python 变量为参数的 Shell 脚本
- python - 如何使用 xpath 创建循环?
- matlab - 错误:在 NSGA II 中,此操作的数组大小不兼容