I have a dataset in which one column represents monthly Date:from 02/01/2004 to 09/01/2008, i have to create a dummy for the Dates in 2008. I tried to use:
dummy <- as.numeric(Date >= 01/01/2008)
,
but R said me that:
">= is not meaningful for factors"
hence i tried to transform the factor variable Date in a numeric one, but all my Dates disappeared, substituted with some random numbers.