[R] nrow()

Erik Iverson eriki at ccbr.umn.edu
Tue Feb 22 16:50:30 CET 2011


Sandra,

Please provide a small, reproducible example of this issue.
You probably want to use ?is.nan and not the inequality
operator.

Similar example, contrast:

x <- NA
is.na(x)
x == NA

Sandra Stankowski wrote:
> Hey there,
> 
> I tried to count the number of rows, where my data isn't NaN in a 
> certain column.
> 
> this was my guess:
> 
> (given is a data frame with 2069 rows and 17 cols)
> 
> NROW(data[jan,16] != NaN)
> 
> ("jan" is defined this way: jan <- which(data[,2]==1, arr.ind= TRUE))
> 
> 
> but I only get the number of columns where my data is "1" in the second 
> col. R isn't removing the NaN.
> na.rm isn't working here.
> 
> I would appreciate your help.
> 
> ______________________________________________
> 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.



More information about the R-help mailing list