Dear everybody,
I would like to ask for help. I would like to create a new variable named "order", which based on the order of the year. (For example , 2001 -> 1; 2002 ->2, 2003->3 )
I would like to ask for help. Thank you in advance.
data.frame(
year = c(2001L,2002L,2003L,2004L,2001L,2002L,
2003L,2004L,2001L,2002L),
ticker = as.factor(c("AAA","AAA","AAA",
"AAA","BBC","BBC","BBC","BBC","DCC","DCC"))
)