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

Add new course for R reproducible environments #26

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

Conversation

rmccreath
Copy link
Member

No description provided.

Copy link
Member

@Moohan Moohan left a comment

Choose a reason for hiding this comment

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

I have some knowledge of renv but have never 'properly used it on an ongoing project...

I've made a few suggestions and typo fixes etc. Looks great and looking forward to sharing it with my team to start using renv!

Comment on lines +70 to +72
```{r renv-libraries, echo=FALSE, fig.align='center'}
knitr::include_graphics("images/renv-libraries.png")
```
Copy link
Member

Choose a reason for hiding this comment

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

I found this graphic a bit confusing, I think probably some form of nesting would convey the concept better...

I had a quick go at a nested hex (fun little diversion), see code and images below. If you agree with my point feel free to use the images/code or trash them and make better ones!

Code to produce
library(ggplot2)
library(phsstyles)
# Data frame for a hexagon ----
angle <- seq(0, 2 * pi, length.out = 7) + pi / 6
polygon_df <- data.frame(
  angle = angle,
  x     = cos(angle),
  y     = sin(angle)
)

# Colours ----
hex_col_1 <- phs_colors("phs-purple")
hex_col_2 <- phs_colors("phs-magenta")
hex_col_3 <- phs_colors("phs-blue")

transparent_white <- "#FFFFFF00"

# Plots with nested hexagons, sequentially dashed.
p_1 <- ggplot(polygon_df) +
  geom_polygon(
    aes(x = x, y = y),
    linetype = "dashed",
    fill = transparent_white,
    colour = hex_col_1
  ) +
  geom_polygon(
    aes(x = x * 2 / 3, y = y * 2 / 3),
    fill = transparent_white,
    colour = hex_col_2
  ) +
  geom_polygon(
    aes(x = x * 1 / 3, y = y * 1 / 3),
    fill = transparent_white,
    colour = hex_col_3
  ) +
  coord_equal() +
  theme_void()

p_2 <- ggplot(polygon_df) +
  geom_polygon(
    aes(x = x, y = y),
    fill = transparent_white,
    colour = hex_col_1
  ) +
  geom_polygon(
    aes(x = x * 2 / 3, y = y * 2 / 3),
    linetype = "dashed",
    fill = transparent_white,
    colour = hex_col_2
  ) +
  geom_polygon(
    aes(x = x * 1 / 3, y = y * 1 / 3),
    fill = transparent_white,
    colour = hex_col_3
  ) +
  coord_equal() +
  theme_void()

p_3 <- ggplot(polygon_df) +
  geom_polygon(
    aes(x = x, y = y),
    fill = transparent_white,
    colour = hex_col_1
  ) +
  geom_polygon(
    aes(x = x * 2 / 3, y = y * 2 / 3),
    fill = transparent_white,
    colour = hex_col_2
  ) +
  geom_polygon(
    aes(x = x * 1 / 3, y = y * 1 / 3),
    linetype = "dashed",
    fill = transparent_white,
    colour = hex_col_3
  ) +
  coord_equal() +
  theme_void()

p_1
p_2
p_3

# Save plots ----
ggsave("outer_hex.png", p_1)
ggsave("middle_hex.png", p_2)
ggsave("inner_hex.png", p_3)

inner_hex
middle_hex
outer_hex

Copy link
Member Author

Choose a reason for hiding this comment

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

Hey, @Moohan - thanks for your review, I've implemented changes based on your suggestions.
The current graphic isn't great, I created it to have something visual but I don't like it either so I'm keen to explore alternatives. While I do like the style of your suggestions, I'm hesitant to show the model as a nested one. I understand where you're coming from but I'm concerned it's misleading from how libraries actually work. I'll have a think...

ReproducibleEnvs.Rmd Show resolved Hide resolved
ReproducibleEnvs.Rmd Outdated Show resolved Hide resolved
ReproducibleEnvs.Rmd Outdated Show resolved Hide resolved
ReproducibleEnvs.Rmd Show resolved Hide resolved
ReproducibleEnvs.Rmd Outdated Show resolved Hide resolved
ReproducibleEnvs.Rmd Outdated Show resolved Hide resolved
ReproducibleEnvs.Rmd Outdated Show resolved Hide resolved
ReproducibleEnvs.Rmd Outdated Show resolved Hide resolved
ReproducibleEnvs.Rmd Outdated Show resolved Hide resolved
Copy link

gitguardian bot commented Jun 28, 2024

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
12263772 Triggered Generic Password 51549fd ReproducibleEnvs.Rmd View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

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