I'm not sure I am answereing your question, but here goes # Create a vector with 2400 items x <- runif(2400)
# Create a 600 by 4 matrix y <- matrix(x,ncol = 4) #If you needed the matrix to be done row by row #y <- matrix(x,ncol = 4,byrow = T) # Extract values from a particular part of the matrix z <- y[500,3] #row 500 column 3 z # Extract values that meet certain criterion z <- y[y < 0.01] z # Find postion of those that are extracted which(y < 0.01) HTH, Tom > -----Original Message----- > From: Lakshmi Dhevi Baskar [mailto:[EMAIL PROTECTED] > Sent: Thursday, 17 March 2005 1:16 PM > To: [EMAIL PROTECTED] > Cc: [email protected] > Subject: [R] help for matrix formation. > > > Dear people, > > I've been trying to find a way to do the following. > > I have a data set in text file with 3 columns and 2400 rows. > i tried to read the table as > fisrt<-("ex.txt",header=FALSE) > > I would like to read the third column values (which has 2400 > value) and split them into matrix of size (600,4): > > as > first 600 column values in first column in matrix and next > 600 next values(600 to 1200) as values in second column in > matrix and so on. > > and could you also suggest me how to retrieve those items in > matrix like matrix(520,3) =0 ... > > thanks in advance for the help. > > > > --------------------------------- > > > [[alternative HTML version deleted]] > > ______________________________________________ > [email protected] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
