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 -- --- Emre ÜNAL [[alternative HTML version deleted]]
Here is how to read it in. Then you can run your analysis:> x <- read.csv(textConnection("Label,Value+ Good,10 + Bad,12 + Good,15 + Good,18 + Good,12 + Bad,15 + Bad,10"))> xLabel Value 1 Good 10 2 Bad 12 3 Good 15 4 Good 18 5 Good 12 6 Bad 15 7 Bad 10 On 10/30/07, Emre Unal <emre.unal at gmail.com> 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 > > > > > > > > > > -- > --- > Emre ?NAL > > [[alternative HTML version deleted]] > > > ______________________________________________ > 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. > >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve?
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.
Excuse me for less detailed e-mail I've sent before, I guess there's a misunderstanding here. My problem is to use the data in the order I've typed below without splitting it. Is it possible? I really don't know. Some statistics packages do it. Original Data is; Good,Bad 10,12 15,15 18,10 12 But I have the data in the following form, Label,Value Good,10 Bad,12 Good,15 Good,18 Good,12 Bad,15 Bad,10 And I want to analyze the data without splitting it. I guessed whether there's a quick/simple solution to my problem. Array functions do solve this problem in general. Now I'm reading the help files about "How to deal with arrays in R environment?". Thx a lot for your concern Emre ---------- Forwarded message ---------- From: Emre Unal <emre.unal@gmail.com> Date: Oct 30, 2007 4:39 PM Subject: data format To: r-help@r-project.org 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 -- --- Emre ÜNAL -- --- Emre ÜNAL http://www.geocities.com/dusemre http://dusemre.blogspot.com ICQ: 5712269 [[alternative HTML version deleted]]