Hi,
I would like to get a simple code to download DBs and unarchive them repeatedly.
Here is what I currently have:
# Attribution of download links
DB2021<- ftp://link1.7z
DB2020<- ftp://link2.7z
DB2019<- ftp://link3.7z
#etc
# Creating a temporary file
tf <- tempfile()
# Downloading the DB to the temporary file and unarchiving
download.file(DB2021, tf,mode="wb",quiet=T)
archive_extract(tf, dir="DB2021")
download.file(DB2020, tf,mode="wb",quiet=T)
archive_extract(tf, dir="DB2020")
download.file(DB2019, tf,mode="wb",quiet=T)
archive_extract(tf, dir="DB2019")
#etc
I would like to avoid repeating the last two lines as many times as there are DBs
That's why I thought of something like:
download.file(BD20i, tf,mode="wb",quiet=T)
archive_extract(tf, dir="BD20i")
#for i from 00 to 22.
Do you have any ideas for getting something simple and non-repetitive?