My dataset is in a long format that has the names of countries, years and values in the columns.
I want new dataset for each country and for each year, I can do it individually but repeating that 195 is not great so I want to do it using "for"
This works for and individual country
Mali = filter(datosUnicef , CountryName == "Mali")
But this doesn't seems to work
for (i in datosUnicef$CountryName) {
i = filter(datosUnicef , CountryName == i)
}
how can I make it work?