Skip to content

Instantly share code, notes, and snippets.

@davidcomfort
Created November 15, 2015 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidcomfort/bbe0669e39d4d6714562 to your computer and use it in GitHub Desktop.
Save davidcomfort/bbe0669e39d4d6714562 to your computer and use it in GitHub Desktop.
child_mortality <- gs_key("0ArfEDsV3bBwCcGhBd2NOQVZ1eWowNVpSNjl1c3lRSWc",lookup = FALSE, verbose=FALSE) %>% gs_read(ws = "Data", check.names=FALSE)
## Accessing worksheet titled "Data"
democracy_score <- gs_key("0ArfEDsV3bBwCdGQ2YlhDSWVIdXdpMmhLY2ZZRHdNNnc",lookup = FALSE, verbose=FALSE) %>% gs_read(ws = "Data", check.names=FALSE)
## Accessing worksheet titled "Data"
life_expectancy <- gs_key("tiAiXcrneZrUnnJ9dBU-PAw",lookup = FALSE, verbose=FALSE) %>% gs_read(ws = "Data", check.names=FALSE)
## Accessing worksheet titled "Data"
population <- gs_key("phAwcNAVuyj0XOoBL_n5tAQ",lookup = FALSE, verbose=FALSE) %>% gs_read(ws = "Data", check.names=FALSE)
## Accessing worksheet titled "Data"
colnames(child_mortality)[1]
## [1] "Under five mortality"
# I tried to figure a way to change column names on multiple data frames at once, but was unable to get the right syntax.
colnames(democracy_score)[1] <- c("Country")
colnames(gdp_per_capita)[1] <- c("Country")
colnames(child_mortality)[1] <- c("Country")
colnames(life_expectancy)[1] <- c("Country")
colnames(population)[1] <- c("Country")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment