Skip to content

Commit

Permalink
Re-build README
Browse files Browse the repository at this point in the history
  • Loading branch information
jennybc committed Jul 5, 2023
1 parent 88fb7fe commit 7b62cba
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Expand Up @@ -75,7 +75,7 @@ readxl_example()
#> [5] "deaths.xls" "deaths.xlsx" "geometry.xls" "geometry.xlsx"
#> [9] "type-me.xls" "type-me.xlsx"
readxl_example("clippy.xls")
#> [1] "/private/tmp/Rtmpjectat/temp_libpath3b7822c649d8/readxl/extdata/clippy.xls"
#> [1] "/private/tmp/RtmpM1GkLC/temp_libpatha8e46f7f62bf/readxl/extdata/clippy.xls"
```

`read_excel()` reads both xls and xlsx files and detects the format from
Expand All @@ -90,7 +90,7 @@ read_excel(xlsx_example)
#> 1 5.1 3.5 1.4 0.2 setosa
#> 2 4.9 3 1.4 0.2 setosa
#> 3 4.7 3.2 1.3 0.2 setosa
#> # … with 147 more rows
#> # 147 more rows

xls_example <- readxl_example("datasets.xls")
read_excel(xls_example)
Expand All @@ -100,7 +100,7 @@ read_excel(xls_example)
#> 1 5.1 3.5 1.4 0.2 setosa
#> 2 4.9 3 1.4 0.2 setosa
#> 3 4.7 3.2 1.3 0.2 setosa
#> # … with 147 more rows
#> # 147 more rows
```

List the sheet names with `excel_sheets()`.
Expand All @@ -120,15 +120,15 @@ read_excel(xlsx_example, sheet = "chickwts")
#> 1 179 horsebean
#> 2 160 horsebean
#> 3 136 horsebean
#> # … with 68 more rows
#> # 68 more rows
read_excel(xls_example, sheet = 4)
#> # A tibble: 1,000 × 5
#> lat long depth mag stations
#> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 -20.4 182. 562 4.8 41
#> 2 -20.6 181. 650 4.2 15
#> 3 -26 184. 42 5.4 43
#> # … with 997 more rows
#> # 997 more rows
```

There are various ways to control which cells are read. You can even
Expand Down Expand Up @@ -163,15 +163,15 @@ read_excel(xlsx_example, range = cell_cols("B:D"))
#> 1 3.5 1.4 0.2
#> 2 3 1.4 0.2
#> 3 3.2 1.3 0.2
#> # … with 147 more rows
#> # 147 more rows
read_excel(xlsx_example, range = "mtcars!B1:D5")
#> # A tibble: 4 × 3
#> cyl disp hp
#> <dbl> <dbl> <dbl>
#> 1 6 160 110
#> 2 6 160 110
#> 3 4 108 93
#> # … with 1 more row
#> # 1 more row
```

If `NA`s are represented by something other than blank cells, set the
Expand All @@ -185,7 +185,7 @@ read_excel(xlsx_example, na = "setosa")
#> 1 5.1 3.5 1.4 0.2 <NA>
#> 2 4.9 3 1.4 0.2 <NA>
#> 3 4.7 3.2 1.3 0.2 <NA>
#> # … with 147 more rows
#> # 147 more rows
```

If you are new to the tidyverse conventions for data import, you may
Expand Down

0 comments on commit 7b62cba

Please sign in to comment.