On May 22, 2013, at 5:00 AM, catalin roibu wrote:
> Hello all!
> I have a problem to transform this list in a data frame. I try
> this command as.data.frame, but unsuccessfully.
> Please help me!
>
> thank you very much!
>
> structure(list(fns = list(structure(list(r = c(0, 0.048828125,
> 0.097
Thanks again,
A.K.
- Original Message -
From: David L Carlson
To: 'arun' ; 'R help'
Cc:
Sent: Sunday, July 1, 2012 5:09 PM
Subject: RE: [R] list to dataframe conversion-testing for identical
Yes it does have something to do with the representation of floating point
numbers.
HI All,
Thanks for your replies.
A.K.
- Original Message -
From: David Winsemius
To: arun
Cc: R help
Sent: Sunday, July 1, 2012 6:31 PM
Subject: Re: [R] list to dataframe conversion-testing for identical
On Jul 1, 2012, at 5:09 PM, David L Carlson wrote:
> Yes it does h
On Jul 1, 2012, at 5:09 PM, David L Carlson wrote:
Yes it does have something to do with the representation of floating
point
numbers. Using cbind() forces the list to become a matrix and that
forces
all of the data to become character strings since one of the list
elements
is character:
Hello,
But
> all.equal(dat1,dat2)
[1] TRUE
So I guess it does have to do with floating-point equality, all.equal
uses .Machine$double.eps. (Which could return FALSE on ocasions we would
expect TRUE, when, for instance, the tolerance could/should be
.Machine$double.eps^0.5.)
Rui Barradas
E
Yes it does have something to do with the representation of floating point
numbers. Using cbind() forces the list to become a matrix and that forces
all of the data to become character strings since one of the list elements
is character:
> set.seed(42)
> listdat1<-list(rnorm(10,20),rep(LETTERS[1:2
Does this do what you want:
> list <- list(A=1:4, B=1:6, C=1:9)
> result <- lapply(names(list), function(x){
+ data.frame(name = x
+ , length = length(list[[x]])
+ , gt5 = sum(list[[x]] > 5)
+ , lt5 = sum(list[[x]] < 5)
+ )
+ })
> do.call(rbind, result)
name l
Hi,
> Try
>
> list <- list(1:4, 1:6, 1:9)
> t(sapply(list, function(x) c(length(x), sum(x > 5), sum(x < 5
>
thank you...the sapply approach seems straight forward, although I don't get
the names into an own column... When the list elements are named the name is
used for the rownames. I'd
Try
list <- list(1:4, 1:6, 1:9)
t(sapply(list, function(x) c(length(x), sum(x > 5), sum(x < 5
HTH,
Jorge.-
On Wed, Feb 8, 2012 at 8:50 AM, Johannes Radinger <> wrote:
> Hi,
> I want to "melt" my list and get certain deskriptive factors (length of a
> vector etc.) into a dataframe. Best to
9 matches
Mail list logo