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

StackOverflow https://stackoverflow.com/questions/20934663

  •  24-09-2022
  •  | 
  •  

Pergunta

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

Foi útil?

Solução

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)
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top