[R] PLEASE HELP creating a matrix

hagereseb daniel.negusse at gmail.com
Mon Jan 30 08:34:57 CET 2012


hello folks, 

i am learning R and microarray analysis from scratch using different sites. 

today i am doing an exercise from
http://manuals.bioinformatics.ucr.edu/home/R_BioCondManual#R_functions

the section i am at is 2. Affymetrix data analysis. 

I understand the syntax given in this section up until: 

design <- model.matrix(~ -1+factor(c(1,1,2,2,3,3))) # Creates appropriate
design matrix. Alternatively, such a design matrix can be created in any
spreadsheet program and then imported into R.

i am stuck at this point. i believe the model.matrix is creating a design
matrix that the data will be put in later. the data in the example is: 

Name			FileName									Target
Shoot12h.1		COLD_CONTROL_12H_SHOOT_REP1.cel		c12h
Shoot12h.2		COLD_CONTROL_12H_SHOOT_REP2.cel		c12h
ColdShoot6h.1	COLD_6H_SHOOT_REP1.cel					t6h
ColdShoot6h.2	COLD_6H_SHOOT_REP2.cel					t6h
ColdShoot12h.1	COLD_12H_SHOOT_REP1.cel				t12h
ColdShoot12h.2	COLD_12H_SHOOT_REP2.cel				t12h

Three experimental samples (duplicates of each giving a total of 6 arrays). 

now back to where i got stuck: 

design <- model.matrix(~ -1+factor(c(1,1,2,2,3,3))) # Creates appropriate
design matrix. Alternatively, such a design matrix can be created in any
spreadsheet program and then imported into R.

what is model.matrix exactly doing? 

my real data that i will analyze after figuring this out has 49 arrays
(columns): 3, 6, 9, 12 month samples with 9 replicates each and then 23
month samples with 13 replicates == total 49. 

how should i create an appropriate design matrix?? PLEASE help? 

thanks, 

daniel 

--
View this message in context: http://r.789695.n4.nabble.com/PLEASE-HELP-creating-a-matrix-tp4340263p4340263.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list