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
values only. I tried your example and it crashed.I
have been reading and looking for a function that
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