Skip to content

Commit

Permalink
Fix R code in Readme (#244)
Browse files Browse the repository at this point in the history
* README.Rmd now reflects the current state of the code base
* Added VScode task to run the REAMDE.Rmd program with the other unit tests to ensure its not broken
  • Loading branch information
gowerc authored Nov 7, 2023
1 parent b4957b2 commit eb01931
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 8 deletions.
25 changes: 24 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,28 @@
},


{
"label": "JMP: Build README",
"type": "R",
"code": [
"devtools::build_readme()"
],
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": false
},
"presentation": {
"echo": false,
"reveal": "always",
"focus": false,
"panel": "dedicated",
"showReuseMessage": true,
"clear": true
}
},


{
"label": "JMP: Run Vignettes",
"type": "shell",
Expand Down Expand Up @@ -125,7 +147,8 @@
"JMP: Run Vignettes",
"JMP: CMD Check (no vig)",
"JMP: Test Pkgdown",
"JMP: Test (with cache)"
"JMP: Test (with cache)",
"JMP: Build README"
],
"problemMatcher": []
},
Expand Down
8 changes: 5 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,19 @@ long_data <- sim_data$lm |>
dplyr::arrange(time, pt)
joint_data <- DataJoint(
survival = DataSurvival(
subject = DataSubject(
data = os_data,
formula = Surv(time, event) ~ cov_cat + cov_cont,
subject = "pt",
arm = "arm",
study = "study"
),
survival = DataSurvival(
data = os_data,
formula = Surv(time, event) ~ cov_cat + cov_cont
),
longitudinal = DataLongitudinal(
data = long_data,
formula = sld ~ time,
subject = "pt",
threshold = 5
)
)
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ You can install the current development version from GitHub with:

``` r
if (!require("remotes")) {
install.packages("remotes")
install.packages("remotes")
}
remotes::install_github("genentech/jmpost")
```
Expand All @@ -75,6 +75,9 @@ right format.

``` r
library(jmpost)
#> Registered S3 method overwritten by 'GGally':
#> method from
#> +.gg ggplot2
set.seed(321)
sim_data <- simulate_joint_data(
lm_fun = sim_lm_random_slope(),
Expand All @@ -85,17 +88,19 @@ long_data <- sim_data$lm |>
dplyr::arrange(time, pt)

joint_data <- DataJoint(
survival = DataSurvival(
subject = DataSubject(
data = os_data,
formula = Surv(time, event) ~ cov_cat + cov_cont,
subject = "pt",
arm = "arm",
study = "study"
),
survival = DataSurvival(
data = os_data,
formula = Surv(time, event) ~ cov_cat + cov_cont
),
longitudinal = DataLongitudinal(
data = long_data,
formula = sld ~ time,
subject = "pt",
threshold = 5
)
)
Expand Down

0 comments on commit eb01931

Please sign in to comment.