[R] r bug (?) display of data
Uwe Ligges
ligges at statistik.tu-dortmund.de
Thu Jul 9 11:41:13 CEST 2009
Marc Jekel wrote:
> Hi R Fans,
>
> I stumbled across a strange (I think) bug in R 2.9.1. I have read in a
> data file with 5934 rows and 9 columns with the commands:
>
> daten = data.frame(read.table("C:/fussball.dat",header=TRUE))
>
> Then I needed a subset of the data file:
>
> newd = daten[daten[,1]!=daten[,2],]
>
> --> two values do not meet the logical specification and are dropped.
>
> The strange thing about it: When I print the newd in the R Console, the
> output still shows 5934 rows.
No 5932 rows, but with the original rownames (with 2 of them missing).
Uwe Ligges
When I check the number of rows with
> NROW(newd) , I get 5932 as output. When I print newd[5934, ], I get NAs.
> When I print newd[5932, ] I get the row that is listed in line 5934 when
> I just type in newd. This is totally crazy! Has anyone had the same
> problem? Thanks for a post.
>
> Marc
>
> ______________________________________________
> 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