Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor clean-up translation vignette setup #531

Merged
merged 4 commits into from
Jul 29, 2024

Conversation

IndrajeetPatil
Copy link
Member

Hopefully, this slightly improves the setup chunk code, irrespective of whether it solves #527 or not.

@@ -21,16 +21,22 @@ knitr::opts_chunk$set(

pkgs <- c(
"dplyr",
"datawizard",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to check if {datawizard} is available.

@@ -39,7 +47,7 @@ This vignette can be referred to by citing the following:

Patil et al., (2022). datawizard: An R Package for Easy Data Preparation and Statistical Transformations. *Journal of Open Source Software*, *7*(78), 4684, https://doi.org/10.21105/joss.04684

```{css, echo=FALSE, eval = evaluate_chunk}
```{css, echo=FALSE, eval = TRUE}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to eval CSS code conditionally. Doesn't hurt us if it is evaluated.

@@ -84,10 +92,6 @@ This vignette is largely inspired from `{dplyr}`'s [Getting started vignette](ht
</div>

```{r, eval = evaluate_chunk}
library(dplyr)
library(tidyr)
library(datawizard)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We always load all needed libraries in the setup chunk. Happy to revert this if you think this reduces readability of the vignette.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to show explicitly what packages are used so I'd like to keep this chunk (with eval=FALSE since they are loaded in setup)

@@ -84,10 +92,6 @@ This vignette is largely inspired from `{dplyr}`'s [Getting started vignette](ht
</div>

```{r, eval = evaluate_chunk}
library(dplyr)
library(tidyr)
library(datawizard)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to show explicitly what packages are used so I'd like to keep this chunk (with eval=FALSE since they are loaded in setup)

Comment on lines 40 to 42
if (can_vignette_be_evaluated) {
evaluate_chunk <- TRUE
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this. Why not put evaluate_chunk <- all_deps_available && getRversion() >= "4.1.0" and remove this if condition?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. No need for an extra level of indirection.

Copy link
Member

@etiennebacher etiennebacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IndrajeetPatil IndrajeetPatil merged commit 46938ce into main Jul 29, 2024
22 checks passed
@IndrajeetPatil IndrajeetPatil deleted the clean-up-translation-vignette branch July 29, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants