i'm teaching myself R right now. I'm trying to convert integer variables into categorical with the following. 

```
train[, c("Store", "DayOfWeek")] <- apply(train[,c("Store", "DayOfWeek")], 2, as.factor)

```

but it's turning the variables into characters instead. can't figure out why - except possibly R coercion. 

```
'data.frame':   1017209 obs. of  2 variables:
 $ Store        : chr  "1" "2" "3" "4" ...
 $ DayOfWeek    : chr  "5" "5" "5" "5" ...

```

when i do it to the vars individually (instead of using apply), it works. THanks