Re: [R] FW: R Statistics

2014-12-03 Thread Chel Hee Lee
Or, you may use this approach: > attach(achtergrond) > spits <- ifelse(uurenminuut >= 5.30 & uurenminuut < 9.30, "morning", + ifelse(uurenminuut >=16.30 & uurenminuut < 19.0, "evening", + "between")) > table(spits) spits between evening morning 1636 142 579 > I personally like the app

Re: [R] FW: R Statistics

2014-12-02 Thread William Dunlap
You can do this in 2 steps - have cut() make a factor with a different level for each time period then use levels<-() to merge some of the levels. > z <- cut(.5:3.5, breaks=c(0,1,2,3,4), labels=c("0-1", "1-2", "2-3", "3-4")) > levels(z) [1] "0-1" "1-2" "2-3" "3-4" > levels(z) <- c("betw

[R] FW: R Statistics

2014-12-02 Thread Dries David
> > Hey > > I have a question about making a new variable in R. I have put my dataset > > in attachment. I have to make a new variable "spits" where spits=morning > > when uurenminuut (also a variabel) is between 5.30 and 9.30, when > > uurenminuut is between 16.30 and 19.0 spits has to be equa