Skip to content
Hélène LANGET, PhD edited this page Aug 15, 2023 · 7 revisions

RStudio

Find in Files window

Ctrl + Shift + F to call the Find in Files window. It allows you to search through files in a directory that you can specify (even outside the project). You can jump between elements you found by double-clicking them in the Find in Files window which opens next to the console.

Packages

Add a dependency in the namespace of a package

See stackoverflow post

library(usethis)
usethis::use_package("dplyr")

How to get LaTeX symbols in tables

"Average" = ~qwraps2::mean_sd(days, denote_sd = "paren", na_rm = TRUE)
kableExtra::footnote(general = "Mean and standard deviation (SD) are represented by the format \\\\textit{mean (SD)}.",
                      escape = FALSE)

How to export package documentation in *.pdf

See stackoverflow

pack <- "timci"
path <- find.package(pack)
system(paste(shQuote(file.path(R.home("bin"), "R")),"CMD", "Rd2pdf", shQuote(path)))

Use Rmarkdown in a modular way

Render Rmarkdown by passing different parameters

Use eval conditions

Use child Rmarkdown documents