I have colnames which need " " because they have spaces,
however trying to calculate
rowSums(myTibble[ , c("var name1" : "var name11")], na.rm = FALSE)
results in error:
Error in "var name1" : "var name11" : NA/NaN argument
I want to use names, not colnumbers, and tried with " " and quotes on tilde key but to no success. What is wrong?
PS
I found a workaround (rowSums(myTibble[,c(match("var name1", colnames(myTibble)) : match("var name11", colnames(myTibble)))], na.rm = FALSE) but it is not neat / looks ugly