[R] detect if data is normal or skewed (without a boxplot)

Felipe Carrillo mazatlanmexico at yahoo.com
Sun Aug 10 22:55:26 CEST 2008


Hello all:
Is there a way to detect in R if a dataset is normally distributed or skewed without graphically seeing it? The reason I want to be able to do this is because I have developed and application with Visual Basic where Word,Access and Excel "talk" to each other and I want to integrate R to this application to estimate confidence intervals on fish sizes (mm). I basically want to automate the process from Excel by detecting if my data has a normal distribution then use t.test, but if my data is skewed then use wilcox.test. Something like the pseudo code below:

fishlength <- c(35,32,37,39,42,45,37,36,35,34,40,42,41,50)
   if fishlength= "normally distributed" then
 t.test(fishlength)
else
wilcox.text(fishlength)

I hope this isn't very confussing
 

Felipe D. Carrillo  
Supervisory Fishery Biologist  
Department of the Interior  
US Fish & Wildlife Service  
California, USA



More information about the R-help mailing list