Skip to content

Commit

Permalink
docs(vignettes): follow LSP's diagnostic messages
Browse files Browse the repository at this point in the history
  • Loading branch information
atusy committed Mar 14, 2023
1 parent 248dfed commit ad09c65
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vignettes/format_columns.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The first point can be solved by using a `for` loop, however, the code becomes q
df <- data.frame(Oxide = c("SiO2", "Fe2O3"), stringsAsFactors = FALSE)
ft <- flextable::flextable(df)
for (i in seq(nrow(df))) {
for (i in seq_len(nrow(df))) {
ft <- flextable::compose(
ft,
i = i,
Expand Down Expand Up @@ -95,7 +95,9 @@ The following example elegantly simplifies the prior example.
df <- data.frame(Oxide = c("SiO2", "Fe2O3"), stringsAsFactors = FALSE)
df %>%
dplyr::mutate(Oxide = stringr::str_replace_all(Oxide, "([2-9]+)", "~\\1~")) %>%
dplyr::mutate(
Oxide = stringr::str_replace_all(Oxide, "([2-9]+)", "~\\1~")
) %>%
flextable::flextable() %>%
ftExtra::colformat_md()
```
Expand Down

0 comments on commit ad09c65

Please sign in to comment.