简体   繁体   English

R 初学者:如何组合两个变量并将它们合并到一个新的数据帧中

[英]R Beginner: how to combine two variables and merge them into a new dataframe

If I have the mean and standard error from the mean (SE) for a particular set of numbers, how would I go about combining the two values into one dataframe?如果我有一组特定数字的均值 (SE) 的均值和标准误差,我将如何将这两个值组合成一个数据帧? For example, I have the variable mean_boeing (for the average) and stde_boeing (for the error from the mean) and I want to combine these two into one dataframe.例如,我有变量 mean_boeing(平均值)和 std_boeing(平均值误差),我想将这两者合并为一个数据帧。 Ultimately, I will be doing this for several other variables, combining them all into one big dataframe so that I can graph them in ggplot.最终,我将对其他几个变量执行此操作,将它们全部组合成一个大数据框,以便我可以在 ggplot 中绘制它们。

Thanks谢谢

我们可以使用data.frame创建一个 data.frame

df1 <-  data.frame(mean_boeing, stde_boeing)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM