Message-ID: <008901d84487$fead65c0$fc083140$@sbcglobal.net>
Date: 2022-03-30T22:46:27Z
From: Jeff Reichman
Subject: inserting relative path - purrr
R-help
Having to perform an iteration so I'm looking at the purr package. The
problem I had was the files (*.csv) are in a Data subdirectory so I used the
paste0 function to concatenate the subdirectory's relative path and the file
name from the files list. While this works just fine is there a better way
of adding the files path?
# Load purrr library
library(purrr)
# Use map to iterate
all_files_purrr <- map(paste0("../Data/", files), read_csv)
# Output size of list object
length(all_files_purrr)
Jeff