Hello. I am working through the Coronavirus Project on the Analyze Data With R Skill Path.
In code block #8 I wrote this:
transposed_confirmed <- countries_confirmed %>% t() %>% as.data.frame()
transposed_confirmed
In code block #9 I wrote this:
library(janitor)
# Make the first row the column titles
transposed_confirmed <- transposed_confirmed %>% row_to_names(row_number = 1)
transposed_confirmed
A problem resulting from this is that the column names don’t actually become the country names as they should.
I just tried typing in the code again and I got this.
I have no idea why the row_to_names() function is doing this.
What’s going on?