Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest openxlsx2 instead of openxlsx #1615

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Imports:
leaflet,
maps,
nycflights13,
openxlsx,
openxlsx2,
palmerpenguins,
repurrrsive (>= 1.1.0),
tidymodels,
Expand Down
2 changes: 1 addition & 1 deletion intro.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ For example, we'll use the following packages because they provide interesting d
install.packages(
c("arrow", "babynames", "curl", "duckdb", "gapminder",
"ggrepel", "ggridges", "ggthemes", "hexbin", "janitor", "Lahman",
"leaflet", "maps", "nycflights13", "openxlsx", "palmerpenguins",
"leaflet", "maps", "nycflights13", "openxlsx2", "palmerpenguins",
"repurrrsive", "tidymodels", "writexl")
)
```
Expand Down
10 changes: 5 additions & 5 deletions spreadsheets.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,11 @@ read_excel("data/bake-sale.xlsx")

### Formatted output

The writexl package is a light-weight solution for writing a simple Excel spreadsheet, but if you're interested in additional features like writing to sheets within a spreadsheet and styling, you will want to use the [openxlsx package](https://ycphs.github.io/openxlsx).
We won't go into the details of using this package here, but we recommend reading <https://ycphs.github.io/openxlsx/articles/Formatting.html> for an extensive discussion on further formatting functionality for data written from R to Excel with openxlsx.
The writexl package is a light-weight solution for writing a simple Excel spreadsheet, but if you're interested in additional features like writing to sheets within a spreadsheet and styling, you will want to use the [openxlsx2 package](https://janmarvin.github.io/openxlsx2/).
We won't go into the details of using this package here, but we recommend reading <https://janmarvin.github.io/openxlsx2/articles/openxlsx2_style_manual.html> for an extensive discussion on further formatting functionality for data written from R to Excel with openxlsx2.

Note that this package is not part of the tidyverse so the functions and workflows may feel unfamiliar.
For example, function names are camelCase, multiple functions can't be composed in pipelines, and arguments are in a different order than they tend to be in the tidyverse.
Note that this package is not part of the tidyverse.
For example, arguments are in a different order than they tend to be in the tidyverse.
However, this is ok.
As your R learning and usage expands outside of this book you will encounter lots of different styles used in various R packages that you might use to accomplish specific goals in R.
A good way of familiarizing yourself with the coding style used in a new package is to run the examples provided in function documentation to get a feel for the syntax and the output formats as well as reading any vignettes that might come with the package.
Expand Down Expand Up @@ -496,7 +496,7 @@ A good way of familiarizing yourself with the coding style used in a new package
print(n = 7)
```

4. Recreate the `bake_sale` data frame, write it out to an Excel file using the `write.xlsx()` function from the openxlsx package.
4. Recreate the `bake_sale` data frame, write it out to an Excel file using the `write_xlsx()` function from the openxlsx2 package.

5. In @sec-data-import you learned about the `janitor::clean_names()` function to turn column names into snake case.
Read the `students.xlsx` file that we introduced earlier in this section and use this function to "clean" the column names.
Expand Down
Loading