I have a column in my data that has just the minute corresponding to the time of an error code. I want to create a new column called i$rminute that splits the time into four, fifteen minute intervals.
>for(j in i$rminute) {
if(i$rminute < 16){
i$r15intervals <- "1"
} else if(i$rminute < 31){
i$r15intervals <- "2"
} else if(i$rminute < 46){
i$r15intervals <- "3"
} else {
i$r15intervals <- "4"}}
>i$r15intervals <- as.factor(i$r15intervals)
> summary(i$r15intervals)
2
78455
So the only number it returns is 2, What am I doing wrong? why is it not creating a new column with with variables 1 through 4 that corresponds to each fifteen minute interval?
I'm still new to R, i'm guessing there is something very obvious that I'm doing wrong.