ok thanks, but I just got it right. Although I don't know what was the
problem.
just thanks for your effort!!!
--
View this message in context:
http://r.789695.n4.nabble.com/data-dividing-tp4646314p4646325.html
Sent from the R help mailing list archive at Nabble.com.
_
Hello,
Your function works,
> sapply(1:12, Jahreszeit)
[1] "Winter""Winter""Fruehling" "Fruehling" "Fruehling" "Sommer"
[7] "Sommer""Sommer""Herbst""Herbst""Herbst" "Winter"
but not with your data? We don't know what your data looks like. Post an
example using ?dput
hey
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")
}else{
if (x>=03 && x<=05) {return("Fruehling")
}else{
if (x>=06 && x<=08) {return("Sommer")
}else{
if (x>=09 && x<=11) {return("Herbst")
}
Now, I
3 matches
Mail list logo