Skip to content
Back to formatted view

Raw Message

Message-ID: <1313654861433-3752007.post@n4.nabble.com>
Date: 2011-08-18T08:07:41Z
From: Daniel Malter
Subject: How to get the descriptive statistic of the whole dataframe?
In-Reply-To: <CANDXbipxaez_E1t2yrQMzg60CebcvOqZAn_+JCsrD8DHie2whQ@mail.gmail.com>

look into the *apply series of functions. In your case

apply(name.of.your.data.frame,2,min)

or 

apply(name.of.your.data.frame,2,max)

will do. You can also put any summary function to your liking instead of
min/max.

Best,
Daniel


Lao Meng wrote:
> 
> Hi all:
> If I have a dataframe of N columns.If I wanna get the min(or max,or
> mean...etc)of the whole dataframe,how to do it quickly?
> What I can do is only:
> min(data[,1:ncol(data)])
> 
> Any other suggestion?
> 
> Thanks!
> 
> best
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 

--
View this message in context: http://r.789695.n4.nabble.com/How-to-get-the-descriptive-statistic-of-the-whole-dataframe-tp3751857p3752007.html
Sent from the R help mailing list archive at Nabble.com.