On 07 May 2014, at 17:55 , Marc Schwartz wrote:
>> as.data.frame(sapply(mtcars[, c("mpg", "disp")], summary))
I'd use lapply() rather than sapply() here. That goes directly from a list to a
data frame, avoiding the detour via a matrix.
--
Peter Dalgaard, Professor
Center for Statistics, Cop
On May 7, 2014, at 5:15 AM, Abhinaba Roy wrote:
> Hi R-helpers,
>
> sumx <- summary(mtcars[,c("mpg","disp")])
>> sumx
> mpg disp
> Min. :10.40 Min. : 71.1
> 1st Qu.:15.43 1st Qu.:120.8
> Median :19.20 Median :196.3
> Mean :20.09 Mean :230.7
> 3rd Qu.:22.80 3rd
Hi R-helpers,
sumx <- summary(mtcars[,c("mpg","disp")])
> sumx
mpg disp
Min. :10.40 Min. : 71.1
1st Qu.:15.43 1st Qu.:120.8
Median :19.20 Median :196.3
Mean :20.09 Mean :230.7
3rd Qu.:22.80 3rd Qu.:326.0
Max. :33.90 Max. :472.0
I want a dataframe as
3 matches
Mail list logo