I am trying to calculate mean of a column call Speed of answer in seconds but because of white spaces it's giving error.
How should one write the column name that contains white space
Code
mean[mydata$Speed of answer in seconds]
use backticks
mean[mydata$`Speed of answer in seconds`]
Or, if you don't want to use backticks, you can use [[. Such as
mean(mydata[['Speed of answer in seconds']]). Doing this is much less common than using $, but can be useful if you need to loop over column names.