I want to import multiple csv files from FTP Server in R (R is local / on my mac). Files should be stored in an R-object, e. g. in a data.frame
.
I only know how to import a single file in a dataframe
:
url <- "ftp://xxx/testfolder/test.csv"
userpwd = "xxx:yyy"
text_data <- getURL(url, userpwd = userpwd, connecttimeout = 60)
df <- read.csv(text = text_data, header = TRUE)
How can I apply it on several files. I guess applying function apply
can help but I don not really know how to do it.