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

Documentation: create vignettes #184

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

m-kolomanski
Copy link
Collaborator

@m-kolomanski m-kolomanski commented Jan 30, 2025

Issue

Closes #75, #180

Description

  • Adds a setup for adding vignettes / articles generated by the pkgdown package.
  • Migrates the user guide, previously in a PDF file, to a vignette.
  • Adds some custom styling and classes for notes, warnings and important stuff to make the pages a bit nicer.

How to test

  1. Checkout the branch.
  2. Run pkgdown::build_site_github_pages(dest_dir = "page") in R console.
  3. Navigate to page/ folder and open index.html file in your browser of choice - this should launch the preview of the page.

Notes to reviewer

If there is anything you wish to be changed in the actual documentation (README or the starter guide) please let me know or feel free to push the changes yourself!

@m-kolomanski m-kolomanski linked an issue Jan 30, 2025 that may be closed by this pull request
1 task
@m-kolomanski m-kolomanski force-pushed the documentation/create-vignettes branch 2 times, most recently from b663d6f to 33564da Compare January 30, 2025 13:07
@m-kolomanski m-kolomanski force-pushed the documentation/create-vignettes branch from 33564da to 2836bdc Compare January 30, 2025 13:17
@m-kolomanski m-kolomanski marked this pull request as ready for review January 30, 2025 15:46
Copy link
Collaborator

@Gero1999 Gero1999 left a comment

Choose a reason for hiding this comment

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

Thank you for the vignettes, they look amazing! Only thing I wanted to propose also solve #180 by:

  • Suggestion: add in Step 1: Data upload the format requirements of the dataset expected (data.frame display / image...).

I think this can be a good idea based on the feedback I received yesterday on the pdf. Not sure what do you think is the best way to represent this. Either putting a link that directs the user to the sample dataset in a new window, embedding the dataset directly into this guide or using an image with the specifications. However I will provide all of them, feel free to modify!

Expected dataset format in R code

df <- tibble::tibble(
  STUDYID = character(),             # Character
  USUBJID = character(),             # Character/Numeric (Study ID + Subject ID format)
  TRT01A = character(),               # Character (Actual Treatment Group Identifier)
  TRT01P = character(),               # Character (Planned Treatment Group Identifier)
  AGE = numeric(),                    # Numeric (Age of Subject)
  RACE = character(),                 # Character (Race of Subject)
  SEX = character(),                  # Character (Sex of Subject)
  ANALYTE = character(),               # Character (Analyte Name)
  PCSPEC = character(),                # Character (Specimen Material Type)
  AVAL = numeric(),                    # Numeric (Analysis Value)
  DOSNO = numeric(),                   # Numeric (Dose Number)
  ROUTE = factor(levels = c("intravascular", "extravascular")), # Factor with specific levels
  DOSEA = numeric(),                   # Numeric (Actual Treatment Dose)
  ADOSEDUR = numeric(),                 # Numeric (Actual Duration of Treatment Dose)
  AFRLT = numeric(),                    # Numeric (Actual Relative Time from Analyte First Dose)
  ARRLT = numeric(),                    # Numeric (Actual Relative Time from Reference Dose)
  NFRLT = numeric(),                    # Numeric (Nominal Relative Time from Analyte First Dose)
  NRRLT = numeric(),                    # Numeric (Nominal Relative Time from Reference Dose)
  AVALU = character(),                   # Character (Analysis Value Unit)
  DOSEU = character(),                   # Character (Treatment Dose Unit)
  RRLTU = character()                    # Character (Relative Time Unit)
)

Dataset example in R code

# Load necessary package
library(tibble)

# Create a dataframe with 8 rows
df <- tibble::tibble(
  STUDYID = rep("S001", 8),                  # Character
  USUBJID = rep(c("S001-001", "S001-002"), each = 4),  # Character/Numeric
  TRT01A = rep(c("A", "B"), each = 4),       # Character
  TRT01P = rep(c("C", "D"), each = 4),       # Character
  AGE = rep(c(35, 42), each = 4),            # Numeric
  RACE = rep(c("Asian", "Caucasian"), each = 4),  # Character
  SEX = rep(c("M", "F"), each = 4),          # Character
  ANALYTE = rep("DrugX", 8),                 # Character
  PCSPEC = rep("Plasma", 8),                 # Character
  AVAL = runif(8, 10, 20),                   # Numeric (random values between 10 and 20)
  DOSNO = rep(1:2, times = 4),               # Numeric (Dose Number)
  ROUTE = rep(c("intravascular", "extravascular"), times = 4),  # Character
  DOSEA = rep(c(50, 100, 75, 150), times = 2),  # Numeric (Different doses per subject)
  ADOSEDUR = rep(c(24, 48), times = 4),      # Numeric (Different durations)
  AFRLT = runif(8, 0.1, 2.0),                # Numeric (random times)
  ARRLT = runif(8, 0.5, 2.5),                # Numeric (random times)
  NFRLT = runif(8, 0.1, 2.0),                # Numeric (random times)
  NRRLT = runif(8, 0.5, 2.5),                # Numeric (random times)
  AVALU = rep("ng/mL", 8),                   # Character
  DOSEU = rep("mg", 8),                      # Character
  RRLTU = rep("hours", 8)                    # Character
)

# Print the dataframe
print(df)

Image attached

Screenshot 2025-01-29 162104

README.md Outdated Show resolved Hide resolved
@m-kolomanski m-kolomanski force-pushed the documentation/create-vignettes branch from 4f94286 to 8485f94 Compare February 7, 2025 15:33
@m-kolomanski m-kolomanski requested a review from Gero1999 February 7, 2025 15:33
@m-kolomanski
Copy link
Collaborator Author

@Gero1999 I have implemented the table with dataset requirements, let me know what you think!

@Gotfrid, @js3110, @Shaakon35 Would love your thoughts on that one!

Copy link
Collaborator

@Gero1999 Gero1999 left a comment

Choose a reason for hiding this comment

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

lgtm thanks!

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.

Enhancement: Documentation - Create vignettes
2 participants