[R] Excel file Import - to Matrix format
Hi, New to R. Need a bit of help. Thanks I am trying to import data from Excel file. The package I am trying to use requires data in Matrix format. Excel -> R Matrix with the constraint that the very first column in Excel file should became the names for rows of the matrix. Example. Data has 1000 rows and 11 columns. 1st column is the names of Genes 10 coulmns of numerical data. I need to read this into R. it should be a 1000 (row) X 10 Column (Matrix) 1st column of Excel file becomes name of the rows. I am experimenting with reading as data frame (as I am unable to find any info on reading into matrix) split the data frame, etc. Thanks truly appreciate your help. What I need: http://r.789695.n4.nabble.com/file/n4637332/thisWorks2.png http://r.789695.n4.nabble.com/file/n4637332/doesNotWork1.png -- View this message in context: http://r.789695.n4.nabble.com/Excel-file-Import-to-Matrix-format-tp4637332.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] Frame Column to List (conversion)
Hi, Input Format: excel file (XLS) Column 1: Gene ID (alphanumeric) Column 2 - 10 : (numeric data). inData = read.xls ( ) geneLabel = inData [ , 1] - column 1 stored in geneLabel tempData = inData [ , 2: 10] expValues = data.matrix (tempData) - convert frame into Matrix format expValues has the matrix format needed for analysis. I need to bind gene labels as . I have this data in geneLablel (extracted from data.frame) How do I convert this to a list so i can use rownames(expValues) <- ??? thanks -- View this message in context: http://r.789695.n4.nabble.com/Frame-Column-to-List-conversion-tp4637341.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.