[R] Removing NAs from dataframe (for use in Vioplot)
mike at hsm.org.uk
Sat Apr 30 21:58:40 CEST 2016
First post and a relative R newbie....
I am using the vioplot library to produce some violin plots. I have an input CSV with columns off irregular length that contain NAs. I want to strip the NAs out and produce a multiple violin plot automatically labelled using the headers. At the moment I do this
ds1 = read.csv("http://www.lecturematerials.co.uk/data/spelling.csv")
vioplot(y6, y5, y4,y3,y2,y1,horizontal=TRUE, names=c("Y6", "Y5","Y4","Y3","Y2","Y1"), col = "lightblue")
1. Is there a more elegant way of automatically stripping the NAs, passing the columns to the function along with the header names??
2. Can I easily add the sample size to each violin plotted??
More information about the R-help