I'm reading ISLR and in the Carseats file, I use:
Price <- as.factor(Price)
to make the variable Price a Factor for experiment. However, when I put:
str(Carseats)
it still shows that Price is Num not Factor. Of course when I try:
class(Price)
it is Factor. So, how do I really change the data type? I.E., how to change the data type in the csv file as well?