Hi i have panel data and would like to reshape or cast my Indicator name column from long to wide format. currently all the columns are in long format, Year(1960-2011), Country Name (all the countries in the world), Indicator name (varying by different indicators) and Value(individual values corresponding to year, indicator name and country name). How can i do this can someone help please. I would like the various indicators to be in the wide format with the corresponding value below it and on the other columns year and country name. Please help
Indicator.Name Year Country
GDP 1960 USA
GDP 1960 UK
Country Name Year GDP PPP HHH
USA 1960 7 9 10
Uk 1960 9 10 NA
World 1960 7 5 3
Africa 1960 3 7 NA
reshape2
package. Specifically,dcast
. You'll want something likedcast(yourdata, Country + Year ~ Indicator.Name, value.var='Value')
. – Justin