我在尝试从 Eurostat 下载批量数据时遇到了一些麻烦,希望您能帮助我。我基于这篇文章的代码。
library(devtools)
require(devtools)
install_github("rsdmx", "opensdmx")
require(rsdmx)
# Make a temporary file (tf) and a temporary folder (tdir)
tf <- tempfile(tmpdir = tdir <- tempdir())
## Download the zip file
download.file("http://ec.europa.eu/eurostat/estat-navtree-portlet-prod/BulkDownloadListing?sort=1&file=data%2Frd_e_gerdsc.sdmx.zip", tf)
## Unzip it in the temp folder
test <- unzip(tf, exdir = tdir)
sdmx <- readSDMX(test)
stats <- as.data.frame(sdmx)
head(stats)
我收到此警告,并且数据框为空:
Warning message:
In if (attr(regexpr("<!DOCTYPE html>", content), "match.length") == :
the condition has length > 1 and only the first element will be used