[R] data format

Julian Burgos jmburgos at u.washington.edu
Tue Oct 30 18:54:39 CET 2007


There are many ways.  A simple one is to use split() to divide your 
'Value' column using your 'Label' column as index.  For example,

# Create dataset
mydata=data.frame(Label=c('Good','Bad','Good','Good','Good','Bad','Bad'),
Value=c(10,12,15,18,12,15,10))

# Split the data
mydata=split(mydata$Value,mydata$Label)

# Do a ks test
ks.test(mydata[[1]],mydata[[2]])


Julian




Emre Unal wrote:
> Hi,
> 
> How can I analyze the data collected in database formatting (with labels)
> rather than splitted by individual columns (almost in excel)?
> 
> For example (comma separated data);
> 
> Label,Value
> Good,10
> Bad,12
> Good,15
> Good,18
> Good,12
> Bad,15
> Bad,10
> etc...
> 
> ks.test or chisq.test can be done.
> Splitting the data into new columns is not applicable cos' I'll use
> R-integration in another software.
> 
> 
> 
> Thanks for your concern
> Emre
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list