I generally use the following approach, based on dplyr/tidyr:
data = tibble(File = files) %>%
extract(File, "Site", "([A-Z]{2}-[A-Za-z0-9]{3})", remove = FALSE) %>%
mutate(Data = lapply(File, read_csv)) %>%
unnest(Data) %>%
select(-File)
More Related Contents:
- Grouping functions (tapply, by, aggregate) and the *apply family
- Access lapply index names inside FUN
- How do you read multiple .txt files into R? [duplicate]
- Read multiple CSV files into separate data frames
- lapply vs for loop – Performance R
- Read all files in a folder and apply a function to each data frame
- Faster way to read fixed-width files
- Same function over multiple data frames in R
- Returning anonymous functions from lapply – what is going wrong?
- Access and preserve list names in lapply function
- passing several arguments to FUN of lapply (and others *apply)
- How to index an element of a list object in R
- lapply-ing with the “$” function
- What are the performance differences between for-loops and the apply family of functions?
- How to tell lapply to ignore an error and process the next thing in the list?
- Writing multiple data frames into .csv files using R
- Using lapply to apply a function over list of data frames and saving output to files with different names
- Creating a named list from two vectors (names, values)
- Union of intersecting vectors in a list in R
- How does one access the piped data.frame in dplyr::funs?
- Split a vector into chunks
- Convert date-time string to class Date
- Assign unique ID based on two columns [duplicate]
- What is the significance of the new Reference Classes?
- Setting Defaults for geoms and scales ggplot2
- Normalizing y-axis in histograms in R ggplot to proportion
- Can I load a saved R object into a new object name?
- Ordering of points in R lines plot
- stumped on how to scrape the data from this site (using R)
- Override column types when importing data using readr::read_csv() when there are many columns