首页 > 解决方案 > R将数据文件从ftp导入数据框

问题描述

如何将数据文件从 ftp 导入 data.frame?

我用:

userpwd <- "user:pw"
h <- curl::new_handle()
curl::handle_setopt(
handle = h,
httpauth = 1,
userpwd = userpwd
)

resp <- curl::curl_fetch_disk("ftp://xxx/testfolder/", "test.csv", handle = h)

但是现在该怎么办?如何将我的测试文件夹中的数据文件从 FTP 带到 R 对象,例如。在数据框中?以及如何从 testfolder 中选择特定的数据文件?

标签: rimportftp

解决方案


推荐阅读