[R] FW: R Statistics

Dries David dries-david at hotmail.com
Tue Dec 2 20:32:48 CET 2014


> > 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 equal to evening. But here is my problem: for all the values not between 5.30- 9.30 and 16.30-19.0 spits must be equal to "between"
> >   
> > achtergrond$minuutdec=achtergrond$minuut/100
> > achtergrond$uurenminuut=achtergrond$uur+achtergrond$minuutdec
> > achtergrond$spits=cut(uurenminuut,c(-1.0,5.30,9.30,16.30,19.0,24.0),labels=c("between","morning","between","evening","between"),right=FALSE)
> >   
> > When I do this i get a warning message, because I use between more than once as label. Between has to be one label that covers all values that are not in morning and evening.
> >   
> > Could you help me with this?
> >   
> > Kind regards
> >   
> > Dries David
> >   		 	   		
> 

 		 	   		  
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: achtergrondlawaai.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20141202/847f419d/attachment.txt>


More information about the R-help mailing list