Message-ID: <6AC14078-E5C7-44DA-812D-B2E2C5E3A25B@comcast.net>
Date: 2011-01-31T22:43:02Z
From: David Winsemius
Subject: Storing loop output in matrix
In-Reply-To: <AANLkTinwVg_yjRiC4jzUgnbTUQfY_+OJeoadwf5bx8gT@mail.gmail.com>
On Jan 31, 2011, at 4:49 PM, Dean Castillo wrote:
> Hello
> I am trying to store output from a loop into an empty matrix. The
> current code I am using is:
>> M<-mat.or.vec(11,89)
R code to create a matix would use the matrix function,
>> for (j in list(3,91))
> + {M[,(j-2)]<-pic(datain[,j], mytree)}
>
You seem to be coming from a programming paradigm tha t uses "," where
R would use ":"
list(3,91) is a two element object rather than 3:91 which would be an
89 element object.
Perhaps you should read some introductory material and get a better
handle in the R syntax through self study.
http://cran.r-project.org/doc/manuals/R-intro.pdf
> datain is a matrix (11,91). I only want to use the pic() function on
> the columns 3:91.
What pic function???
> ?pic
No documentation for 'pic' in specified packages and libraries:
you could try '??pic'
> When I use this code output is stored into the 1st column of M and the
> 89th column of M but no other columns.
>
> Any help would be greatly appreciated
>
> Dean
David Winsemius, MD
West Hartford, CT