Skip to contents

Retrieves all of the sheets in a given Microsoft Excel workbook and stores them as elements in a list. Note that the guts of this function were created by the developers of `readxl::read_excel()` and we merely created a wrapper function to invoke their work more easily.

Usage

read_xl_sheets(file_name = NULL)

Arguments

file_name

(character) Name of (and path to) the Excel workbook

Value

(list) One tibble per sheet in the Excel workbook stored as separate elements in a list

Examples

# Read in each sheet as an element in a list
read_xl_sheets(file_name = system.file("extdata", "excel_book.xlsx", package = "scicomptools"))
#> $first_table
#> # A tibble: 4 × 2
#>   col_1 col_2
#>   <chr> <dbl>
#> 1 cat       2
#> 2 dog       1
#> 3 bird      3
#> 4 fish      5
#> 
#> $second_table
#> # A tibble: 3 × 3
#>   name  order  quantity
#>   <chr> <chr>     <dbl>
#> 1 Alex  item_1       65
#> 2 Jane  item_2       23
#> 3 Max   item_3       30
#> 
#> $third_table
#> # A tibble: 4 × 4
#>   date                site   plot  species  
#>   <dttm>              <chr>  <chr> <chr>    
#> 1 2023-01-04 00:00:00 site_1 A     species_1
#> 2 2023-02-10 00:00:00 site_1 B     species_1
#> 3 2023-03-11 00:00:00 site_2 A     species_1
#> 4 2023-04-28 00:00:00 site_2 B     species_1
#>