Skip to content

Commit

Permalink
Update vignettes to pass R CMD CHECK on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed Jul 20, 2023
1 parent d8137a1 commit 453fd11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions vignettes/openxlsx2.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -185,22 +185,22 @@ In `openxlsx2` functions that interact with worksheet cells are using `dims` as

```{r}
# various options
wb_dims(4)
wb_dims(start_row = 4)
wb_dims(rows = 4, cols = 4)
wb_dims(rows = 4:10, cols = 5:9)
wb_dims(rows = 4:10, cols = "A:D")
wb_dims(mtcars)
wb_dims(x = mtcars)
# in a wb chain
wb <- wb_workbook()$
add_worksheet()$
add_data(x = mtcars)$
add_fill(
dims = wb_dims(mtcars, start_row = 5),
dims = wb_dims(x = mtcars, start_row = 5),
color = wb_color("yellow")
)
```
Expand Down
10 changes: 5 additions & 5 deletions vignettes/openxlsx2_style_manual.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ colnames(mat) <- make.names(seq_len(ncol(mat)))
border_col <- wb_color(theme = 1)
border_sty <- "thin"
# using wb_dims() to avoid counting manually which `dims` are spanned.
dims_mat_header <- wb_dims(col = seq_len(ncol(mat)), rows = 1)
# using ) to avoid counting manually which `dims` are spanned.
dims_mat_header <- wb_dims(rows = 1, cols = seq_len(ncol(mat)))
# returns "A1:AB1"
# prepare workbook with data and formated first row
wb <- wb_workbook() %>%
Expand Down Expand Up @@ -119,7 +119,7 @@ wb$styles_mgr$add(new_cellxfs, "new_styles")
# assign the new cell style to the header row of our data set
# Achieve the same with `wb_dims()` and sprintf
# cell <- sprintf("A1:%s1", int2col(nrow(mat)))
cell <- wb_dims(col = seq_len(ncol(mat)), rows = 1)
cell <- wb_dims(rows = 1, cols = seq_len(ncol(mat)))
wb <- wb %>% wb_set_cell_style(
dims = cell,
style = wb$styles_mgr$get_xf_id("new_styles")
Expand Down Expand Up @@ -326,8 +326,8 @@ wb <- wb_workbook() %>%
wb_add_worksheet("test") %>%
wb_add_data(
x = mat,
dims = wb_dims(start_col = 2, start_row = 2)
)
dims = wb_dims(2, 2)
)
# create a border style and assign it to the workbook
black <- wb_color("black")
Expand Down

0 comments on commit 453fd11

Please sign in to comment.