I have several dataframes with firm-advisor relationships, one for each year of interest.
For instance, the 2015 dataframe looks like this. Let's call it advisors2015 (then I have also advisors2014, advisors2013, advisors2012, and so on):
> advisors2015
[,1] [,2] [,3] [,4]
colnam "Mark" "Company.name" "Company.ID" "Advisor.Name"
row1 "1" "VOLKSWAGEN AG" "DE2070000543" "PRICEWATERHOUSECOOPERS"
row2 " " "VOLKSWAGEN AG" "DE2070000543" "PWC DEUTSCHE REVISION"
row3 " " "VOLKSWAGEN AG" "DE2070000543" "C&L TREUARBEIT REVISION"
row4 "2" "ROYAL DUTCH SHELL PLC" "GB04366849" "LLOYDS TSB REGISTRARS"
row4 "2" "ROYAL DUTCH SHELL PLC" "GB04366849" "LLOYDS TSB REGISTRARS"
row5 " " "ROYAL DUTCH SHELL PLC" "GB04366849" "PRICEWATERHOUSECOOPERS"
row6 " " "ROYAL DUTCH SHELL PLC" "GB04366849" "KPMG ACCOUNTANTS NV"
row7 " " "ROYAL DUTCH SHELL PLC" "GB04366849" "ERNST & YOUNG"
row8 "3" "BP PLC" "GB00102498" "CAPITA ASSET SERVICES"
And this is for 2014:
> advisors2014
[,1] [,2] [,3] [,4]
colnam "Mark" "Company.name" "Company.ID" "Advisor.Name"
row1 "1" "VOLKSWAGEN AG" "DE2070000543" "PRICEWATERHOUSECOOPERS"
row2 " " "VOLKSWAGEN AG" "DE2070000543" "PWC DEUTSCHE REVISION"
row3 " " "VOLKSWAGEN AG" "DE2070000543" "C&L TREUARBEIT REVISION"
row4 "2" "ROYAL DUTCH SHELL PLC" "GB04366849" "LLOYDS TSB REGISTRARS"
row5 " " "ROYAL DUTCH SHELL PLC" "GB04366849" "PRICEWATERHOUSECOOPERS"
row6 "3" "BP PLC" "GB00102498" "CAPITA ASSET SERVICES"
row7 "4" "COCACOLA" "GB111222333" " "
As you can see, each company may have one ore more advisors. Of course they may also change over time: this year (that means in this dataframe) VOLKSWAGEN has 3 advisors but next year it may have just one, or substitute some of them with some others.
In order to keep track of all these changes, I would like to have a dataframe where for each company/year observation I save the list of advisors.
I know that we can do this using the nest
function, but as far as I understand it is for creating lists from columns in the same dataframe, while I have multiple dataframes, say 10, like the ones above.
Could anyone help me to manage this issue? Many thanks.