I'm new to R. The professor asked us to obtain sum, mean and variance for several columns of data which are in Excel form. Now, I want to try to use R to solve them rather than enter the formula in Excel and drag. I have imported the data into R and they are correctly displayed. I can use the commands sum ()
and sd ()
and var ()
for EACH column.
My question is: is there a way to let R display the sum, sd, and variance for each column at the same time? (Rather than calculating these again and again for each column).
I mean something like colSum(col1, col2, col3,...)
and the line just shows the sum for each column.