[R] data dividing

bambus sonja_lae at hotmail.com
Tue Oct 16 11:26:22 CEST 2012

I'd like to divide my data into four seasons. for this I made a function:

Jahreszeit <- function(x) {
if (x<=02 || x==12)  {return("Winter")
if (x>=03 && x<=05) {return("Fruehling")
if (x>=06 && x<=08) {return("Sommer")
if (x>=09 && x<=11) {return("Herbst")

Now, I have some trouble to apply this function. 
I tried lapply(), sapply() and tapply() but everytime i get for every month
just "Winter". which isn't right. 
Does someone now an explanation?
if i try it with some random vector it does work but not with my data. 
Please, I need help...has anyone an idea? thx

View this message in context: http://r.789695.n4.nabble.com/data-dividing-tp4646314.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list