I am trying to get the standard deviation over specific columns in R. Unfortunately there doesnt seem to be a rowmeans type function so I am a bit lost. The dataset is as follows
chr leftPos strand JWA JWB JWC JWD OE33_F
chr1 100202137 + 2 0 1 0 0
chr1 100260304 - 141 62 75 55 20
chr1 100724039 - 0 1 0 0 0
and I would like to get the standard deviations for column headers JWA, JWB and JWD as follows. Please note that I dont think this question has been asked before as I am trying to get a simple standard deviation per row rather than as a column standard deviation. Also this is a dataframe which seems to make getting st dev from it a lot trickier than if it was a matrix.
chr leftPos strand JWA JWB JWC JWD OE33_F stdev
chr1 100202137 + 2 0 1 0 0 x
chr1 100260304 - 141 62 75 55 20 y
chr1 100724039 - 0 1 0 0 0 z
What can I use instead of rowmeans and how can I specify which columns I am interested in
Thanks in advance