R rbind - unexpected symbol error when merging rows from two data frames

廉价感情. 提交于 2019-12-24 04:19:33

问题


I am trying to merge data vertically from two separate data frames as shown below. I believe I've met the criteria, namely both have the same column names. Does anyone see why I'm getting the error below?

> str(rnorm.SR.df)
'data.frame':   20 obs. of  2 variables:
 $ criticalMeasureCount: num  3.37 1.77 1.29 1.79 2.09 ...
 $ projectType        : chr  "SR" "SR" "SR" "SR" ...`

> str(rnorm.nonSR.df)
'data.frame':   30 obs. of  2 variables:
 $ criticalMeasureCount: num  3.635 1.057 0.836 3.722 5.887 ...
 $ projectType        : chr  "Non-SR" "Non-SR" "Non-SR" "Non-SR" ...
> rnorm.allprojects.df <- rbind(data rnorm.nonSR.df, data rnorm.SR.df)
Error: unexpected symbol in "rnorm.allprojects.df <- rbind(data rnorm.nonSR.df"

Thanks for your help


回答1:


Error: unexpected symbol in "rnorm.allprojects.df <- rbind(data rnorm.nonSR.df"

What is "data " doing there in "data rnorm.nonSR.df"? Just a typo, isn't it? Probably you meant:

rnorm.allprojects.df <- rbind(rnorm.nonSR.df, rnorm.SR.df)


来源:https://stackoverflow.com/questions/20934663/r-rbind-unexpected-symbol-error-when-merging-rows-from-two-data-frames

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!