0

I'm trying to reshape wide DB to long. I want to get all column names and make them to the year column. How can I get all column names from 1961 to 2016

nsoil <- melt(soil, id.vars = c("CountryName", "Country.Code"),
              measure.vars = c(colnames("1961"......."2016")),
              variable.name = "years"
              value.name = "%AgroLands"
              )
nsoil

Thanks a lot!

Mozzy_Tron
  • 1
  • 1
  • 1

0 Answers0