Zhang Jian wrote:
I find one row in my large dataset. But when I use the "rownames" for the
data on the 100,000 row, the result show nothing.
I try it by the following example, it still likes that.
tst[rownames(tst)==100000,]
[1] x y
<0 rows> (or 0-length row.names)
##############
tst=data.frame(x=1:200000,y=200000:1)
tst[rownames(tst)==1,]
x y
1 1 200000
tst[rownames(tst)==10000,]
x y
10000 10000 190001
tst[rownames(tst)==100000,]
[1] x y
<0 rows> (or 0-length row.names)
tst[100000,]
x y
100000 100000 100001
Is it a bug for R?
No, it's your use of a non-character rowname, viz
> tst[rownames(tst)=="100000",]
x y
100000 100000 100001
Hints:
> 1000
[1] 1000
> 100000
[1] 1e+05
> options(scipen=10)
> tst[rownames(tst)==100000,]
x y
100000 100000 100001
Perhaps R should do a bit less coercing.
-Peter Ehlers
[[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.
--
Peter Ehlers
University of Calgary
______________________________________________
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.