Skip to content

Commit

Permalink
Merge pull request #200 from Merck/housekeeping
Browse files Browse the repository at this point in the history
Fix typos and update URL
  • Loading branch information
nanxstats committed Oct 12, 2023
2 parents c762257 + fba3381 commit 116d6b7
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 26 deletions.
6 changes: 3 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
## Improvements

* Improve grammar and style for the main vignette (@howardbaek, #144).
* Add libreoffice 7.4 and 7.5 support (#156).
* Add LibreOffice 7.4 and 7.5 support (#156).
* Add citation details (#155).

# r2rtf 1.0.1
Expand All @@ -42,7 +42,7 @@

## Improvements

* Add support for libreoffice 7.3 (#92).
* Add support for LibreOffice 7.3 (#92).

# r2rtf 1.0.0

Expand Down Expand Up @@ -100,7 +100,7 @@

## Improvements

* Avoid specific libreoffice version (#68).
* Avoid specific LibreOffice version (#68).

# r2rtf 0.3.1

Expand Down
4 changes: 2 additions & 2 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
#' A dataset prepared by the Drug Information Association scientific working group
#' to investigate a drug to reduce lower back pain.
#'
#' Definition of each variable can be found in \url{https://missingdata.lshtm.ac.uk/dia-working-group/}
#' Definition of each variable can be found in \url{https://www.lshtm.ac.uk/research/centres-projects-groups/missing-data#dia-missing-data}
#'
#' @format A data frame with 831 rows and 6 variables.
#'
#' @source \url{https://missingdata.lshtm.ac.uk/dia-working-group/}
#' @source \url{https://www.lshtm.ac.uk/research/centres-projects-groups/missing-data#dia-missing-data}
"r2rtf_HAMD17"

#' Within Group Results from an ANCOVA Model
Expand Down
4 changes: 2 additions & 2 deletions R/rtf_rich_text.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ rtf_rich_text <- function(
x = extracted$matches
)
if (length(extracted$tags) != length(extracted$matches)) {
stop("Length missmatch of tags found and matches found.", call. = FALSE)
stop("Length mismatch of tags found and matches found.", call. = FALSE)
}

# For each paired brace: extract the text to be wrapped with `rtf_text()`
Expand All @@ -102,7 +102,7 @@ rtf_rich_text <- function(
x = extracted$matches
)
if (length(extracted$text) != length(extracted$matches)) {
stop("Length missmatch of extracted text found and matches found.", call. = FALSE)
stop("Length mismatch of extracted text found and matches found.", call. = FALSE)
}

# Validate that tags in text are reflected in the `themes` argument
Expand Down
4 changes: 2 additions & 2 deletions man/r2rtf_HAMD17.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vignettes/design-pattern.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ head(iris) %>% # Step 1 Read in data frame
## RTF Encoding

`rtf_encode()` wraps up internal functions in r2rtf package to translate all attributes attached to a data frame
into [RTF syntax](http://www.snake.net/software/RTF/RTF-Spec-1.7.pdf).
A good reference is [RTF pocket guide](https://www.oreilly.com/library/view/rtf-pocket-guide/9781449302047/).
into [RTF syntax](https://web.archive.org/web/20221008045825/http://www.snake.net/software/RTF/RTF-Spec-1.7.pdf).
A good reference is [RTF Pocket Guide](https://www.oreilly.com/library/view/rtf-pocket-guide/9781449302047/).

All of the internal encoding functions in the r2rtf package start with a prefix `as_rtf_`.
For a table, `r2rtf:::rtf_encode_table()` is used internally to translate attribute to RTF syntax by using
Expand Down Expand Up @@ -315,7 +315,7 @@ allowed to key in whatever is defined in dictionary for the rtf_ functions, or e
r2rtf:::font_type()
```

Superscripts, under scripts are taken care of by using `convert()` function to translate them into latex code and unicode. For example:
Superscripts, under scripts are taken care of by using `convert()` function to translate them into LaTeX code and Unicode. For example:

```{r}
r2rtf:::convert(c("^", "<="))
Expand Down
12 changes: 6 additions & 6 deletions vignettes/example-basechar.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ bs_count <- function(data, grp, var,

- Summarize continuous variable
```{r}
bs_continous <- function(data, grp, var,
var_label = var,
decimal = 1,
total = TRUE,
blank_row = FALSE) {
bs_continuous <- function(data, grp, var,
var_label = var,
decimal = 1,
total = TRUE,
blank_row = FALSE) {
data <- data %>% rename(grp = !!grp, var = !!var)
coding <- levels(factor(data$grp))
data <- data %>% mutate(grp = as.numeric(factor(grp)))
Expand Down Expand Up @@ -159,7 +159,7 @@ ana <- ana %>% mutate(
bs_tb <- bind_rows(
bs_count(ana, "TRT01AN", "SEX", "Gender"),
bs_count(ana, "TRT01AN", "AGEGR1", "Age (Years)"),
bs_continous(ana, "TRT01AN", "AGE", "Age (Years)", blank_row = TRUE),
bs_continuous(ana, "TRT01AN", "AGE", "Age (Years)", blank_row = TRUE),
bs_count(ana, "TRT01AN", "RACE", "Race")
) %>% mutate(
var_label = factor(var_label, levels = c("Gender", "Age (Years)", "Race"))
Expand Down
2 changes: 1 addition & 1 deletion vignettes/example-efficacy.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fmt_pval <- function(data, columns = "p.value", decimals = 3) {

### Step 2: ANCOVA analysis for HOMA data

The data is available at <https://missingdata.lshtm.ac.uk/dia-working-group/example-data-sets/>.
The data is available at <https://www.lshtm.ac.uk/research/centres-projects-groups/missing-data#dia-missing-data>.

- Read in data and run ANCOVA model

Expand Down
2 changes: 1 addition & 1 deletion vignettes/example-figure.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ filename %>%
Features of page and figure can be set up in `rtf_page` and `rtf_figure` respectively:

* Page orientation: `orientation` argument in `rtf_page`.
* Figure height and width: `fig_heigth` and `fig_width` arguments in `rtf_figure`.
* Figure height and width: `fig_height` and `fig_width` arguments in `rtf_figure`.

The figure height and width can be set up for each figure in a vector.
The code below provides an example for these features.
Expand Down
2 changes: 1 addition & 1 deletion vignettes/r2rtf.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ LaTeX command `'\\leq'` to generate special character $\leq$.

LaTeX commands can be used for Greek letters and math symbol such as $\alpha$, $\pm$, $\infty$.
You will need to use double backslash `\\` to escape backslash in R. i.e. `"\\alpha"`, `"\\pm"` and `"\\infty"`.
A list of LaTex commands can be found [here](https://www.overleaf.com/learn/latex/List_of_Greek_letters_and_math_symbols).
A list of LaTeX commands can be found [here](https://www.overleaf.com/learn/latex/List_of_Greek_letters_and_math_symbols).

Example below demonstrates this idea.

Expand Down
6 changes: 3 additions & 3 deletions vignettes/rtf-convert-format.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ r2rtf:::rtf_convert_format(
## Overview

`r2rtf` had an experimental internal function `r2rtf:::rtf_convert_format` to
convert RTF format to PDF, DOCX or HTML.
This feature requires [libreoffice7.1](https://www.libreoffice.org/download/download/) and only
be tested in a Linux environment.
convert RTF format to PDF, DOCX, or HTML.
This feature requires LibreOffice >= 7.1 and was only
tested in a Linux environment.

By default, `r2rtf:::rtf_convert_format` convert RTF file to PDF format.
The PDF file will be saved in the same folder with same file name by default.
Expand Down
4 changes: 2 additions & 2 deletions vignettes/rtf-row.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ rtf_db %>%
knitr::include_graphics("pdf/border-example.pdf")
```

* The first and last border of the whole table is controled by `border_first` and `border_last` argument in `rtf_page()`
* The first and last border of the whole table is controlled by `border_first` and `border_last` argument in `rtf_page()`

```{r}
attr(rtf_db, "page")$border_first
Expand All @@ -93,7 +93,7 @@ attr(rtf_db, "page")$border_first
attr(rtf_db, "border_first")
```

For other border, it is controled by a matrix.
For other border, it is controlled by a matrix.

```{r}
rtf_db %>% attr("border_top")
Expand Down

0 comments on commit 116d6b7

Please sign in to comment.