It seems that I missed something obvious here, so I apologize in advance. In any case, here are some data a that I am trying to use:
acct_num year_prem prem exc 001 2012 2763585 exclusive 001 2011 2377688 exclusive 001 2010 2083065 exclusive 001 2009 1751722 exclusive 001 2008 1639484 exclusive
However, casting gives me an error that I could not understand / interpret:
b <- dcast(a, formula= acct_num + exc ~ year_prem, value.var= prem, fill= NA) Error in .subset2(x, i, exact = exact) : invalid subscript type 'list'
I do not think I need fill= NA . But I get the same error with or without her. Any help would be appreciated.
source share