[R] Importing Data for a two sample t-test

arun smartpink111 at yahoo.com
Thu Nov 15 14:43:39 CET 2012


HI,
If you need to separate into two datasets,


 dat1[dat1$company=="A",]
#  weights company
#1       1       A
#2       2       A
#or

 dat1[dat1$company=="B",]

#or split into a list
 split(dat1,dat1$company)



A.K.



----- Original Message -----
From: nilsonern <Nilsonern at gmail.com>
To: r-help at r-project.org
Cc: 
Sent: Wednesday, November 14, 2012 11:52 PM
Subject: [R] Importing Data for a two sample t-test

I am trying to do a two sample t-test with data that i received in a text
document.  one list has the slab weights and the second has the company it
is associated with.  here is an example.

weights  company
1                  A
2                  A  
2                  B
3                  B

I was able to import the data but i cannot figure out how separate the data. 
I want to put them in two separate sets, one being A and one being B.  Any
help would be appreciated.  Thanks.



--
View this message in context: http://r.789695.n4.nabble.com/Importing-Data-for-a-two-sample-t-test-tp4649565.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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