I would like to ask for help.
My file includes data about number of ticker in each month in 10 years. I would like to rearrange my data to check the ticker in each month of each year.
My sample data is like that. I would like to have an arrangement like a picture below.
I appreciate any helps. Thank you in advance.
data<-data.frame(
year = c(2006L,2006L,2006L,2006L,2006L,2006L,
2006L,2006L,2006L,2007L,2007L,2007L,2007L,2007L,2007L,
2007L,2007L,2007L),
month = c(1L,1L,1L,1L,2L,2L,2L,3L,3L,1L,1L,
2L,2L,3L,3L,3L,3L,3L),
ticker = as.factor(c("AGF","BBC","BBS",
"BPC","AGF","BBC","BBS","BBC","AGF","AGF","BBS",
"AGF","CAN","AGF","BBC","BBS","BPC","CAN"))
)