Re: [R] counting values on one colum only

From: Felipe Carrillo <mazatlanmexico_at_yahoo.com>
Date: Sun, 23 Mar 2008 10:10:42 -0700 (PDT)


I was able to figure it out. I used
daysSamp<- na.omit(weekly)
 daysSamp<- nrow(daysSamp)
 daysSamp
>4

I ommited the NA's and then counted the number of rows. Thanks for your time Mark  

> I'm not an R expert but if you show me the
> str(weekly) output, i think I can answer your
> question.
>
>
> >Mark:
> >I basically need to count the number of rows that
> have
> >values only. I tried your example and it crashed.I
> >have been reading and looking for a function that
> does
> >that but no luck...
> >
> >--- markleeds_at_verizon.net wrote:
> >
> >> >From: Felipe Carrillo <mazatlanmexico_at_yahoo.com>
> >> >Date: 2008/03/22 Sat PM 06:16:59 CDT
> >> >To: r-help_at_stat.math.ethz.ch
> >> >Subject: [R] counting values on one colum only
> >>
> >> i'm not sure i understand what you want
> >> because, by definition,
> >> a dataframe can't have a different
> >> number of rows in each column ?
> >> maybe
> >>
> >> i<-nrow(!is.na(weekly$a))
> >>
> >> if the blanks are actually NAs ?
> >>
> >>
> >> >Hi all:
> >> >Can someone help me count the
> >> >number of rows with values in
> >> >colum "a" only. assume the name
> >> >of my dataframe is "weekly"
> >> >I was trying
> >> >i<- nrows(weekly$a)
> >> > i
> >> > but returns 7 when it should
> >> > be 4. Thanks
> >> >a b c d
> >> > 27.000
> >> > 27.000
> >> >1.569 0.013 160.000 27.000
> >> >1.632 0.013 146.000 27.000
> >> >1.830 0.015 70.000 27.000
> >> >2.475 0.019 156.000 27.000
> >> > 27.000
> >> >
> >> > Felipe D. Carrillo
> >> > Fishery Biologist
> >> > Department of the Interior
> >> > US Fish & Wildlife Service
> >> > California, USA
> >> >
> >> >
> >> >
> >> >
> >>
>
>____________________________________________________________________________________
> >> >Be a better friend, newshound, and
> >> >
> >> >______________________________________________
> >> >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.
> >>
> >>
> >
> >
> > Felipe D. Carrillo
> > Fishery Biologist
> > Department of the Interior
> > US Fish & Wildlife Service
> > California, USA
> >
> >
> >
> >
>



> >Looking for last minute shopping deals?

>

>
>

 Felipe D. Carrillo
  Fishery Biologist
  Department of the Interior
  US Fish & Wildlife Service
  California, USA



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. Received on Sun 23 Mar 2008 - 17:13:13 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 23 Mar 2008 - 18:30:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive