-2
I need to add two columns of a date frame..
Example:
Preiso add all rows of the columns rural and urban.
I tried the apply and rowsum codes and all gave error.
Error apply: apply(educa[, 3:4], 2, sum) Error in FUN(newX[, i], ...) 'invalid type' (Character) of argument
rowsum error: rowSums(educates[,3:4]) Error in rowSums(educa[, 3:4]) 'x' must be numerical
Educ["State Enrollment"] = rowSums(educa[,3:4])
Welcome to Stackoverflow! Unfortunately, this question cannot be reproduced by anyone trying to answer it. Please take a look at this link (mainly in the use of function
dput
) and see how to ask a reproducible question in R. So, people who wish to help you will be able to do this in the best possible way.– Marcus Nunes