0
いくつかのチャートをシミュレートするために次のコードを複製しようとしていますが、ダウンロード時にエラーが発生し、.csvファイルを読み込みました。問題は、「入力」ディレクトリの作成方法や場所、コマンドラインへのパスの挿入方法、データがダウンロードされたかどうかわからないことです。誰も助けることができますか?御時間ありがとうございます! r create dir
のためにグーグルでcsvファイルを読み込んでパスを作成
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
質問に適切なタグを付けてください。あなたは 'R'を使っているようですので、それを加えてください。 –
@ Ansjovis86私の印象は、OPが現在の作業ディレクトリに 'input'ディレクトリを作成せず、Rがcsvファイルを作成できないということです。 –