Hi Ion:

Here's something that might work for you
> flight.df <- read.table(file="clipboard",header=TRUE)
> by(flight.df$NoFlights,flight.df$Week,summary)
flight.df$Week: week1
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
  30.00   30.75   32.00   31.75   32.25   36.00
------------------------------------------------------------
flight.df$Week: week2
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
  30.00   30.75   31.50   31.50   32.25   33.00
------------------------------------------------------------
flight.df$Week: week23
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
   28.0    29.0    30.0    31.0    32.5    35.0
------------------------------------------------------------
flight.df$Week: week57
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
     30      30      30      30      30      30
>

Hope this helps!

Sincerely,
Erin



On Mon, Jun 24, 2013 at 6:53 PM, Ion Mateescu <ion.mat...@gmail.com> wrote:

> This may be a simple problem but I spent most of my day today trying to
> figure it out, as I am not a programmer. I have a dataframe with
> observations from different weeks of the year, numbered. My variable
> "week" has values week1, week4, week9, etc. Not all weeks are represented.
> I need to calculate statistics and compare means for a measured variable
> (no_of_flights) :
>
> Week    NoFlights
> week1    31.00
> week1    31.00
> week1    36.00
> week1    32.00
> week1    30.00
> week1    30.00
> week1    30.00
> week2    31.00
> week2    32.00
> week1    30.00
> week1    31.00
> week1    32.00
> week23    30.00
> week23    35.00
> week57    30.00
> week1    32.00
> week1    33.00
> week1    33.00
> week2    30.00
> week2    33.00
> week1    32.00
> week1    32.00
> week1    33.00
> week23    28.00
>
> Any help is appreciated.
>
> River
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@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.
>



-- 
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: erinm.hodg...@gmail.com

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to