I am trying to replicate the following code to simulate some charts and I got error at the time of download (I guess) and read the .csv file. The problem is that I do not know how or where to create the "input" directory, how to put the path in the command line and if the data would be downloaded. Anybody could help? Thanks for your time!
library(idbr)
library(countrycode)
library(ggplot2)
library(animation)
library(dplyr)
countries <- c("France", "Switzerland", "Japan", "China", "United States", "Brazil", "Russia", "Morocco")
country.iso2 <- countrycode(countries, "country.name", "fips104")
translation.file <- "input/Population structures past and forecast - Sheet1.csv"
downloadData <- F
years <- 1990:2050
apikey <- "901083ee90dbd111d13f5e270ca00b4abf654be6"
data.file <- paste0("input/", paste(range(years), collapse = "_"), "_",
paste(country.iso2, collapse = "_"), ".csv")
### load translations
txt <- read.csv(translation.file, row.names = 1, stringsAsFactors = F)
Error in file(file, "rt") : no se puede abrir la conexión
Además: Warning message:
In file(file, "rt") :
no fue posible abrir el archivo 'input/Population structures past and forecast - Sheet1.csv': No such file or directory