Ich versuche, den folgenden Code zu simulieren, um einige Diagramme zu simulieren, und ich habe Fehler beim Download (ich denke) und lesen Sie die .csv-Datei. Das Problem ist, dass ich nicht weiß, wie oder wo das "Eingabe" -Verzeichnis zu erstellen ist, wie man den Pfad in die Befehlszeile einfügt und ob die Daten heruntergeladen werden. Jeder könnte helfen? Vielen Dank für Ihre Zeit!Lesen von CSV-Dateien und Erstellen von Pfaden
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
Bitte kennzeichnen Sie Ihre Frage entsprechend. Es scheint, dass Sie 'R' verwenden, fügen Sie das hinzu. –
@ Ansjovis86 Mein Eindruck ist, dass das OP nicht das Verzeichnis 'input' im aktuellen Arbeitsverzeichnis erstellt hat, das R daran hindert, die CSV-Datei zu erstellen. –