[R] Re: Isnt it a a documentation bug in the data.fram or rbind docu? Re: [R] data.frame package?
Anders Nielsen
anielsen at dina.kvl.dk
Tue Apr 30 17:15:17 CEST 2002
Dear Eryk
On Tue, 2002-04-30 at 17:57, Witold Eryk Wolski wrote:
> Thx i never used and heard about subset.
> Subset isn't mentioned in the see also section of the data.frame function.
> And it is missing in the R intro to.
>
> The rbind description says.
> ... vectors or matrices. (but nothing about data.frames)
>
> And subset is not working for strings.
> But what if you have in your dataframe char (string data)?
> eg.: subset(data1,name=grep("Anders")) wouldn't work.
But the following will:
> dat<-data.frame(name=c("Anders", "Eryk", "Eryk"), y=1:3)
> dat
name y
1 Anders 1
2 Eryk 2
3 Eryk 3
> dat.Anders<-subset(dat, name=="Anders")
> dat.Anders
name y
1 Anders 1
>
Kind regards,
anders.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list