Great! Thanks, Aravind.
On Monday, February 16, 2015 10:50 PM, Aravind Jayaraman
wrote:
Hi,
I think you need not split the data.frame to get the desired result.
You can work with your list lst4 itself.
#Convert the vectors in the list to data.frames.
lst4 <- lapply(lst4, function(x
t; -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Zilefac Elvis
> via R-help
> Sent: 17 February 2015 03:54
> To: R. Help
> Subject: [R] split dataframe to several dataframes in R
>
> Hi All,I have a dataframe called 'means
is Campbell, PhD
>
> Tel. +44 (0)1249 705 450 | Mobile. +44 (0) 7929 628 349
> www.mango-solutions.com
> Mango Solutions
> 2 Methuen Park, Chippenham, Wiltshire. SN14 OGB UK
>
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Zile
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Zilefac Elvis
via R-help
Sent: 17 February 2015 03:54
To: R. Help
Subject: [R] split dataframe to several dataframes in R
Hi All,I have a dataframe called 'means' as shown below:iris1.csv <- iris
Hi All,I have a dataframe called 'means' as shown below:iris1.csv <- iris
iris2.csv <- iris
names <- c("iris1.csv", "iris2.csv")
dat <- mget(names)
lst4 <- lapply(dat, function(x) apply(x[,-5], 2, mean))
# Build the new data frame
means <- as.data.frame(do.call(rbind, lst4))
means$source <- names
Hi,
I think you need not split the data.frame to get the desired result.
You can work with your list lst4 itself.
#Convert the vectors in the list to data.frames.
lst4 <- lapply(lst4, function(x) {as.data.frame(t(iris1.csv))})
#Get the data.frames in the list to the global environment
list2env(ls
Hi All,I have a dataframe called 'means' as shown below:iris1.csv <- iris
iris2.csv <- iris
names <- c("iris1.csv", "iris2.csv")
dat <- mget(names)
lst4 <- lapply(dat, function(x) apply(x[,-5], 2, mean))
# Build the new data frame
means <- as.data.frame(do.call(rbind, lst4))
means$source <- names(
7 matches
Mail list logo