Hi I have a matrix file that is 32X48 and I want to put all of the values into a single dimensional array in R. Right now I am only able to get the last row of data.
trgtFN_intensity <- "1074_B09_1- 4_5mM_Xgal_7d_W.cropped.resized.grey.png.red.median.colony.txt";
read.table(trgtFN_intensity, sep="\t") -> tmp_int
maxrow_int <- nrow(tmp_int);
maxcol_int <- ncol(tmp_int);
Elts_int <- -10;
for (row in 1:maxrow_int){rbind(Elts_int, tmp_int[row,]) -> Elts_int;}
av_int <- mean(Elts_int[Elts_int!=-10]);
sd_int <- sd(Elts_int[Elts_int!=-10]);
penalty_Matrix <- matrix(0, nrow=1536, ncol=1);
for (row in 1:maxrow_int)
{
for (col in 1:maxcol_int)
{
penalty_Matrix[col] <- tmp_int[row, col];
}
}
outFN <- paste(trgtFN_intensity, "array", sep=".");
write.table(penalty_Matrix, file = outFN, col.names=F, row.names=F, sep ="\t")
Any help would be greatly appreciated. Thank you