Dear all,
After I work around, I found in my list of data with only one row which
need to remove or make it as matrix.
Here I write again my other toy example:
x - list(matrix(1:20, 5, 4),matrix(1:20, 5, 4),matrix(1:20, 5,
4),matrix(1:20, 5, 4),matrix(1:20, 5, 4))
y - list(c(1, -1, -1, 1,
Subject: Re: [R] Remove empty list from list - remove only one row and
make as matrix
Dear all,
After I work around, I found in my list of data with only one row
which
need to remove or make it as matrix.
Here I write again my other toy example:
x - list(matrix(1:20, 5, 4),matrix(1:20, 5, 4
://www.student.kuleuven.be/~m0390867/dimitris.htm
- Original Message -
From: Muhammad Subianto [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Sent: Tuesday, August 29, 2006 1:22 PM
Subject: Re: [R] Remove empty list from list - remove only one row and
make as matrix
Dear all,
After I
Dear all,
I am still working with list.
If I have an empty list how can I remove from list data.
Here is a toy example:
x - list(matrix(1:20, 5, 4),matrix(1:20, 5, 4),matrix(1:20, 5,
4),matrix(1:20, 5, 4),matrix(1:20, 5, 4))
y - list(c(1, -1, -1, 1, 1),c(1, 1, -1, -1, -1),c(1, 1, 1, 1, 1),c(1,
1,
Here is a function I use a lot to do this:
delete.NULLs - function(x.list){ # delele null/empty entries in a list
x.list[unlist(lapply(x.list, length) != 0)]
}
delete.NULLs(nc.test)
[[1]]
[,1] [,2] [,3] [,4] [,5]
[1,]16 11 161
[2,]49 14 191
[3,]
See this post from the weekend:
http://www.nabble.com/Re%3A-How-to-iteratively-extract-elements-out-of-a-list-p6002980.html
On 8/28/06, Muhammad Subianto [EMAIL PROTECTED] wrote:
Dear all,
I am still working with list.
If I have an empty list how can I remove from list data.
Here is a toy
On this day 28/08/2006 19:20, Muhammad Subianto wrote:
Dear all,
I am still working with list.
If I have an empty list how can I remove from list data.
Here is a toy example:
x - list(matrix(1:20, 5, 4),matrix(1:20, 5, 4),matrix(1:20, 5,
4),matrix(1:20, 5, 4),matrix(1:20, 5, 4))
y -