extract_df_from_list: Take a list of data frames and write them to individual data...

View source: R/extract_df_from_list.R

extract_df_from_listR Documentation

Take a list of data frames and write them to individual data frames with names

Description

The function will take a list of data frames in the environment and extract each data frame and assign the name from the list.

Usage

extract_df_from_list(list_of_dfs, envir = .GlobalEnv)

Arguments

list_of_dfs

A list with data frames

envir

Environment to assign data frames to. Default is .GlobalEnv.

Value

Data frames; the same number as were contained in the list. Returned to the global environment.

References

https://stackoverflow.com/questions/9726705/assign-multiple-objects-to-globalenv-from-within-a-function

Examples

library(readxl)
path <- readxl::readxl_example("datasets.xlsx")
list_of_sheets <- lamisc::read_excel_all_sheets(path_to_excel_file = path,
                                                as_list = TRUE)
extract_df_from_list(list_of_sheets)


emilelatour/lamisc documentation built on April 9, 2024, 10:33 a.m.