Here only focus on the ftp site.
if(!dir.exists("ftp")) {
dir.create("ftp")
dir.create("ftp/csv")
dir.create("ftp/shapes")
dir.create("ftp/rasters")
}
download.file("ftp://ftp.hafro.is/pub/data/csv/minke.csv",
destfile = "ftp/csv/minke.csv")
download.file("ftp://ftp.hafro.is/pub/data/shapes/bormicon.gpkg",
destfile = "ftp/shapes/bormicon.gpkg")
Then you read in the data from within your project as:
minke <- readr::read_csv("ftp/csv/minke.csv")
bor <- sf::read_sf("ftp/shapes/bormicon.gpkg")