I have a list of dates, for example "1989-10-09" which are characters and I'm trying to organize them by month. By problem is that these are characters and it's difficult to extract just the month from the dates. Right now I'm trying this:
a = as.list(strsplit(official$date[i],split='-'))
Where official is the data frame with a date column. But the result is a list of length one, containing "1989" "10" "09" as a single input with no dimensions. The exact result looks like:
[[1]]
[1] "1959" "10" "05"
If I try a[2] I get NULL