On Mon, 27 Sep 2004, Liaw, Andy wrote:
The problem is that temp2 is a data frame, and the function you are
sapply()ing to returns a row from a data frame. A data frame is really a
list, with each variable corresponding to a component. If you extract a row
of a data frame, you get another
Hi,
I use sapply very frequently, but I have recently noticed a behavior of
sapply which I don't understand and have never seen before. Basically,
sapply returns what looks like a matrix, says it a matrix, and appears to
let me do matrix things (like transpose). But it is also a list and
The problem is that temp2 is a data frame, and the function you are
sapply()ing to returns a row from a data frame. A data frame is really a
list, with each variable corresponding to a component. If you extract a row
of a data frame, you get another data frame, not a vector, even if all
Elizabeth Purdom wrote:
I use sapply very frequently, but I have recently noticed a behavior of
sapply which I don't understand and have never seen before. Basically,
sapply returns what looks like a matrix, says it a matrix, and appears
to let me do matrix things (like transpose). But it is
Elizabeth Purdom epurdom at stanford.edu writes:
:
: Hi,
:
: I use sapply very frequently, but I have recently noticed a behavior of
: sapply which I don't understand and have never seen before. Basically,
: sapply returns what looks like a matrix, says it a matrix, and appears to
: let me