为什么我的数据框不显示添加的列?
我正在使用一个数据集并创建一个数据框来创建一个新列 (bty_average),它是数据框中其他 6 列的平均值。虽然它说它已创建并允许我绘制 bty_average,但当我查看数据框时它不会显示。怎么了?
当前代码如下。
Evaldf <- Eval
Evaldf %>%
mutate(
(bty_average =
bty_f1lower+bty_f1upper+bty_f2upper+bty_m1lower+bty_m1upper+bty_m2upper)/6
)
我也尝试过这样创建,但没有成功:
bty_average <- ((Evaldf$bty_f1lower + Evaldf$bty_f1upper + Evaldf$bty_f2upper + Evaldf$bty_m1lower + Evaldf$bty_m1upper + Evaldf$bty_m2upper)/6)
I'm working with a data set and created a data frame to make a new column (bty_average) which is the mean of 6 other columns in the data frame. While it says it is created and allows me to plot bty_average, it does not show up when I view the data frame. What is wrong?
Current code below.
Evaldf <- Eval
Evaldf %>%
mutate(
(bty_average =
bty_f1lower+bty_f1upper+bty_f2upper+bty_m1lower+bty_m1upper+bty_m2upper)/6
)
I've also tried creating it like this, to no avail:
bty_average <- ((Evaldf$bty_f1lower + Evaldf$bty_f1upper + Evaldf$bty_f2upper + Evaldf$bty_m1lower + Evaldf$bty_m1upper + Evaldf$bty_m2upper)/6)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论