Skip to content
Prev 326061 / 398503 Next

multiple csv files for T-test

Hi,
May be this helps:
#You can use ?read.csv() to read the two files.

set.seed(24)
dat1<- as.data.frame(matrix(sample(20:40,40,replace=TRUE),ncol=4))
set.seed(285)
dat2<- as.data.frame(matrix(sample(35:60,40,replace=TRUE),ncol=4))
sapply(colnames(dat1),function(i) t.test(dat1[,i],dat2[,i],paired=TRUE)$p.value)
#????????? V1?????????? V2?????????? V3?????????? V4 
#3.202629e-05 6.510644e-04 6.215225e-04 3.044760e-04 

A.K.

Hi 
I am fairly new to R so if this is a stupid question please forgive me. 

I have a CSV file with multiple parameters (50). ?I have another
 CSV file with the same parameters after treatment. ?Is there a way I 
can read these two files into R and do multiple paired T-test as all the
 parameters are in the same columns in each file? 

Thanks in advance