Hello,
It must be very easy.
I have data like this:
myframe <- data.frame (ID=c("Ernie", "Ernie", "Ernie", "Bert",
"Bert","Bert", "Duck"), Hunger=c(1,1,1,2,2,1,3) )
myframe
bighunger <- subset (myframe, myframe$Hunger>=2 &myframe$Hunger <3 )
bighunger
verybighunger <- subset(myframe,myframe$Hunger>=3)
verybighunger
hungry <- rbind (bighunger=bighunger,very=verybighunger)
hungry
BUT I want a result like this:
myframesresult <- data.frame(Hunger=c("bighunger","bighunger","very"),
ID=c("Bert", "Bert", "duck"), Hunger=c(2,2,3))
myframesresult
Where is my mistake?
Very many thanks in advance!!
Dagmar
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.