List all sheets in an excel spreadsheet.

excel_sheets(path)

Arguments

path

Path to the xls/xlsx file

Examples

excel_sheets(readxl_example("datasets.xlsx"))
#> [1] "iris" "mtcars" "chickwts" "quakes"
excel_sheets(readxl_example("datasets.xls"))
#> [1] "iris" "mtcars" "chickwts" "quakes"
# To load all sheets in a workbook, use lapply path <- readxl_example("datasets.xls") lapply(excel_sheets(path), read_excel, path = path)
#> [[1]] #> # A tibble: 150 × 5 #> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> <dbl> <dbl> <dbl> <dbl> <chr> #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 1.4 0.2 setosa #> 3 4.7 3.2 1.3 0.2 setosa #> # ... with 147 more rows #> #> [[2]] #> # A tibble: 32 × 11 #> mpg cyl disp hp drat wt qsec vs am gear carb #> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 #> 2 21.0 6 160 110 3.90 2.875 17.02 0 1 4 4 #> 3 22.8 4 108 93 3.85 2.320 18.61 1 1 4 1 #> # ... with 29 more rows #> #> [[3]] #> # A tibble: 71 × 2 #> weight feed #> <dbl> <chr> #> 1 179 horsebean #> 2 160 horsebean #> 3 136 horsebean #> # ... with 68 more rows #> #> [[4]] #> # A tibble: 1,000 × 5 #> lat long depth mag stations #> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 -20.42 181.62 562 4.8 41 #> 2 -20.62 181.03 650 4.2 15 #> 3 -26.00 184.10 42 5.4 43 #> # ... with 997 more rows #>