I'm trying to create a vector using c()
.
I have a column of CIK numbers that I want to put into that vector by a year variable column.
df --> my dataframe name
df$CIK --> CIK column of my dataframe
df$year--> year column of my dataframe # (ranges from 1994-2015)
So ultimately I would want this
CIK1994 <- vector of unique CIKs in 1994
CIK1995 <- vector of unique CIKs in 1995
.....
CIK2015 <- vector of unique CIKs in 2015
Is there an efficient way I can create those vectors using a for-loop / lapply
?