[snip]
sapply. In this case I would expect M to be a list. I am gobsmacked that
a list can be considered a vector. Is that a bug? It must be bad design?
I have been using R for a number of years (5?) and heavilly for two years.
I am still getting bitten by these features in R. To
-Original Message-
From: Worik R [mailto:wor...@gmail.com]
Sent: Wednesday, April 18, 2012 5:05 PM
To: William Dunlap
Cc: r-help
Subject: Re: [R] Can a matrix have 'list' as rows/columns?
[snip]
sapply. In this case I would expect M to be a list. I am gobsmacked
Message-
From: Worik R [mailto:wor...@gmail.com]
Sent: Wednesday, April 18, 2012 5:05 PM
To: William Dunlap
Cc: r-help
Subject: Re: [R] Can a matrix have 'list' as rows/columns?
[snip]
sapply. In this case I would expect M to be a list. I am gobsmacked that
a list can be considered
That is a fine section of 'The R Inferno'
but I don't think it applies to your problem.
The answer to your question in the subject line
is obviously yes. It happens when the matrix
(or more generally any array) is of mode list.
A useful example of this is in Circle 8.1.8.
On Apr 17, 2012, at 12:13 AM, Worik R wrote:
After a lot of processing I get a matrix into M. I expected each
row and
column to be a vector. But it is a list.
This behavior is not the result of limitation in how R's sapply might
have processed a purely numeric set of results, but is
On Tue, Apr 17, 2012 at 11:52 PM, David Winsemius dwinsem...@comcast.netwrote:
On Apr 17, 2012, at 12:13 AM, Worik R wrote:
After a lot of processing I get a matrix into M. I expected each row and
column to be a vector. But it is a list.
This behavior is not the result of limitation in
On Apr 17, 2012, at 7:27 PM, Worik R wrote:
On Tue, Apr 17, 2012 at 11:52 PM, David Winsemius dwinsem...@comcast.net
wrote:
On Apr 17, 2012, at 12:13 AM, Worik R wrote:
After a lot of processing I get a matrix into M. I expected each
row and
column to be a vector. But it is a list.
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf
Of Worik R
Sent: Tuesday, April 17, 2012 4:28 PM
To: r-help
Subject: Re: [R] Can a matrix have 'list' as rows/columns?
On Tue, Apr 17, 2012 at 11:52 PM, David Winsemius
dwinsem...@comcast.netwrote
Not sure this adds to, subtracts from, or obfuscates this thread, but ...
x - list(a=1:3,b = log, c=letters[2],d=as.list(1:5))
is.vector(x)
[1] TRUE
dim(x) - c(2,2)
is.matrix(x)
[1] TRUE
is.vector(x)
[1] FALSE
x
[,1] [,2]
[1,] Integer,3 b
[2,] ? List,5
x[2,1](5)
After a lot of processing I get a matrix into M. I expected each row and
column to be a vector. But it is a list.
R-Inferno says...
Arrays (including matrices) can be subscripted with a matrix of positive
numbers. The subscripting matrix has as many columns as there are dimensions
in the
On Mon, Apr 16, 2012 at 9:13 PM, Worik R wor...@gmail.com wrote:
After a lot of processing I get a matrix into M. I expected each row and
column to be a vector. But it is a list.
Lists are also vectors, e.g.
x - list()
is.vector(x)
[1] TRUE
y - vector(list, length=3)
str(y)
List of 3
$
11 matches
Mail list logo