8

I have a data frame containing huge amount of values. The data frame is as follows

> datedPf
            date ticker quantity
96828 2013-01-11    ABT      700
96829 2013-01-11    AMD     9600
96830 2013-01-11    AMG      600
96831 2013-01-11   AGCO      800
96832 2013-01-11      A     1300
etc...

The type of the "ticker" and "quantity" columns are factor. I found this using class(datedPf$ticker) and class(datedPf$quantity) respectively. But the type of the "date" column is date. I want to change that type to factor. How can I change this?

micstr
  • 5,080
  • 8
  • 48
  • 76
Dinoop Nair
  • 2,663
  • 6
  • 31
  • 51

1 Answers1

18

datedPf$date = as.factor(datePf$date) but are you sure that it is what you want to do ?

statquant
  • 13,672
  • 21
  • 91
  • 162