[R] Error message for MCC

Matt Curcio matt.curcio.ri at gmail.com
Thu Aug 4 00:14:40 CEST 2011


Greetings all,
I am getting an error message that is stifling me.
Any ideas?

> ## Define Directories ##
> load_from <- "/home/mcc/Dropbox/abrodsky/kegg_combine_data/"
> save_to <- "/home/mcc/Dropbox/abrodsky/ttest_results/"
>
> ###############################
> ## Define Columns To Compare ##
> compareA <- "log_b_rich"
> compareB <- "Fc_cdt_rich_tot"
>
> ################################
> ## Collect Files To Compare ##
> setwd(load_from)
> files_to_test <- list.files(pattern = "combine.kegg")
>
> ##########################
> ## Initialize Variables ##
> vl <- length(files_to_test)
> temp <- vector(mode="numeric", length = vl)
> colA <- vector(mode="numeric", length = vl)
> colB <- vector(mode="numeric", length = vl)
> tt <- vector(mode="numeric", length = vl)
>
>
> ########################
> ## Calculate P-values ##
> for (i in 1:3){
+    temp1 <- read.table(files_to_test[i], header=TRUE, sep=" ")
+    numrows <- nrow(temp1)
+    tt_pvalue <- matrix(data=temp, nrow=numrows, ncol=vl)
+    colA <- temp[,compareA]
+    colB <- temp[,compareB]
+    tt <- t.test(colA, colB, var.equal=TRUE)
+    tt_pvalue <- tt$p.value
+ }
Error in temp[, compareA] : incorrect number of dimensions

-- 


Matt Curcio
M: 401-316-5358
E: matt.curcio.ri at gmail.com



More information about the R-help mailing list