Skip to content

Commit

Permalink
fix quotes and improve labels in code chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
RaymondBalise committed Mar 7, 2024
1 parent 3b451a7 commit 27e31bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions vignettes/O4_make_a_package.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Saving your data and analyses into an R package helps to create reproducible res
## How do I make a package project?
All you need to do is add `vignette = TRUE` when you use the `make_project()` function. Once the project is created, run the **run_me.R** file. For example type:

1. `rUM::make_project("~/Desktop/my.example", "R", example=TRUE, vignette=TRUE)`. This creates a new project with all the files for a package in the current directory. The vignette includes an example table and figure and all the R Markdown syntax for adding hyperlinks to the table and figures.
2. After the new project is open, run the **RUN_ME_FIRST.R** file. The easiest way to do this is by typing `source(RUN_ME_FIRST.R)` into the RStudio IDE console and then pressing enter. If you are working in RStudio it will ask you if it can/should close windows for two deleted files. Say **Yes**. They are a couple temporary files that we used to set options the project.
1. `rUM::make_project("~/Desktop/my.example", "R", example = TRUE, vignette = TRUE)`. This creates a new project with all the files for a package in the current directory. The vignette includes an example table and figure and all the R Markdown syntax for adding hyperlinks to the table and figures.
2. After the new project is open, run the **RUN_ME_FIRST.R** file. The easiest way to do this is by typing `source("RUN_ME_FIRST.R")` into the RStudio IDE console and then pressing enter. If you are working in RStudio it will ask you if it can/should close windows for two deleted files. Say **Yes**. They are a couple temporary files that we used to set options the project.

<center>
![](say_yes.png){width="50%"}
Expand Down
12 changes: 9 additions & 3 deletions vignettes/O5_show_example.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ knitr::opts_chunk$set(

## Introduction

If you would like to see an example paper, that has code blocks to produce a summary table and a graphic, include the `example = TRUE` argument when you use the `make_project()` function. For example, if you type `rUM::make_project("~/Desktop/my.example", "R", example=TRUE)`, in the **Results** section of the paper you will see code like:
If you would like to see an example paper, that has code blocks to produce a summary table and a graphic, include the `example = TRUE` argument when you use the `make_project()` function. For example, if you type `rUM::make_project("~/Desktop/my.example", "R", example = TRUE)`, in the **Results** section of the paper you will see code like:

````r
#| tbl-cap: "Cross-references to tables use labels for the code chunk starting with tbl-."
#| tbl-cap: |
#| Your real caption belongs here. Remember that cross references to tables
#| use labels for the code chunk starting with tbl-.


# To learn how to use tbl_summary look at https://www.danieldsjoberg.com/gtsummary/
analysis |>
Expand All @@ -39,7 +42,10 @@ and

````r

#| fig-cap: "Remember figure labels begin with fig-"
#| fig-cap: |
#| Your real caption belongs here. Remember that cross references to figures
#| use labels for the code chunk starting with fig-.

# To learn how to use ggplot start here: https://ggplot2.tidyverse.org/#learning-ggplot2
analysis |>
ggplot() +
Expand Down

0 comments on commit 27e31bc

Please sign in to comment.