You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To understand why R is giving us a warning when we try to add this row, let's learn a little more about factors.
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))
And the fix suggested gapminder$continent <- as.character(gapminder$continent) also needs to be adjusted.
The text was updated successfully, but these errors were encountered:
cengel
changed the title
Episode 4: Data Structures: Exploring Data Frames - no warning with rbind
Episode 4: Data Structures: Exploring Data Frames - rbind and factors
May 30, 2021
R is not giving a warning when executing
rbind(gapminder, new_row)
.gapminder$continent
is not a factor.r-intro-geospatial/_episodes_rmd/04-data-structures-part2.Rmd
Line 262 in 3ae8234
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-intro-geospatial/_episodes_rmd/04-data-structures-part2.Rmd
Line 282 in 3ae8234
And the fix suggested
gapminder$continent <- as.character(gapminder$continent)
also needs to be adjusted.The text was updated successfully, but these errors were encountered: