It does, however, for the same reason, generate a warning message after running this:
levels(gapminder$continent) <- c(levels(gapminder$continent), "Nordic")gapminder_norway <- rbind(gapminder, list('Norway', 2016, 5000000, 'Nordic', 80.3,49400.0, FALSE))
R is not giving a warning when executing
rbind(gapminder, new_row)
.gapminder$continent
is not a factor.https://github.com/datacarpentry/r-intro-geospatial/blob/3ae8234810c878a3b99dc3fc4b6c2ba68d2f4c58/_episodes_rmd/04-data-structures-part2.Rmd#L262
It does, however, for the same reason, generate a warning message after running this:
levels(gapminder$continent) <- c(levels(gapminder$continent), "Nordic")
gapminder_norway <- rbind(gapminder, list('Norway', 2016, 5000000, 'Nordic', 80.3,49400.0, FALSE))
https://github.com/datacarpentry/r-intro-geospatial/blob/3ae8234810c878a3b99dc3fc4b6c2ba68d2f4c58/_episodes_rmd/04-data-structures-part2.Rmd#L282
And the fix suggested
gapminder$continent <- as.character(gapminder$continent)
also needs to be adjusted.