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

Update package installations at top of vignettes #12

Merged
merged 6 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: psm3mkv
Title: Fit and Evaluate Three-State Partitioned Survival Analysis and Markov Models to Progression-Free and Overall Survival Data
Version: 0.2.0
Version: 0.2.0.9000
Authors@R: c(
person("Dominic", "Muston", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-4876-7940")),
Expand All @@ -22,6 +22,7 @@ Imports:
flexsurv,
ggplot2,
purrr,
remotes,
rlang,
SimplicialCubature,
stats,
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# psm3mkv (development version)

# 26 Jan 2024 - Version 0.2

This version provides additional functionality to the calculation of restricted mean durations in `calc_allrmds`. These estimates may now be constrained by a lifetable (see `calc_ltsurv`) and discounting may now be applied. A vignette describing how to use this functionality is provided: `vignette("background-mortality")`.
Expand Down
6 changes: 4 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ The package requires version 4.1 of R (due to use of the [native pipe](https://w
The development version of *psm3mkv* may be downloaded as follows:

``` r
# Install from Github as follows (with the vignette)
remotes::install_github("Merck/psm3mkv", build_vignettes=TRUE)
# Install version 0.2 from Github as follows, with the vignette
remotes::install_github("Merck/psm3mkv",
ref="v0.2",
build_vignettes=TRUE)
```

## Licensing
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ ensure R is updated first.
The development version of *psm3mkv* may be downloaded as follows:

``` r
# Install from Github as follows (with the vignette)
remotes::install_github("Merck/psm3mkv", build_vignettes=TRUE)
# Install version 0.2 from Github as follows, with the vignette
remotes::install_github("Merck/psm3mkv",
ref="v0.2",
build_vignettes=TRUE)
```

## Licensing
Expand Down
25 changes: 20 additions & 5 deletions vignettes/background-mortality.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,28 @@ The calculation of restricted mean durations in *psm3mkv* default to assume no l

### Initializing

First we load the packages we need - all of which are suggested for or imported to *psm3mkv*.
First we load the packages we need - all of which are suggested for or imported to *psm3mkv*. With thanks again to @vbaliga for [this helpful code](https://vbaliga.github.io/posts/2019-04-28-verify-that-r-packages-are-installed-and-loaded/)).

```{r packages, message=FALSE}
library(psm3mkv) # Load psm3mkv itself
library(dplyr) # for data wrangling
library(flexsurv) # for the datasets attached
library(HMDHFDplus) # to create lifetables from the Human Mortality Database
# Install psm3mkv version 0.2 from github
require("remotes")
remotes::install_github("Merck/psm3mkv",
ref="v0.2",
build_vignettes=TRUE)

# First specify the packages of interest
packages = c("psm3mkv", "dplyr", "flexsurv", "HMDHFDplus", "remotes")

# Now load or install & load all
package.check <- lapply(
packages,
FUN = function(x) {
if (!require(x, character.only = TRUE)) {
install.packages(x, dependencies = TRUE)
library(x, character.only = TRUE)
}
}
)
```

### Creating the life table
Expand Down
32 changes: 22 additions & 10 deletions vignettes/example.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,30 @@ knitr::opts_chunk$set(

## Introduction

This vignette walks through evaluating the partitioned survival model (PSM) and state transition model structures (either clock reset, STM-CR, or clock forward types, STM-CF) to a dataset derived from the *bosms3* dataset that comes with the *flexsurv* package.[1] A review of PSMs and STMs in oncology cost-effectiveness models is provided by Woods et al.[2]
This vignette walks through evaluating the partitioned survival model (PSM) and state transition model structures (either clock reset, STM-CR, or clock forward types, STM-CF) to a dataset derived from the *bosms3* dataset that comes with the [flexsurv::flexsurv-package()].[1] A review of PSMs and STMs in oncology cost-effectiveness models is provided by Woods et al.[2]

First we need to install and load the packages of interest (with thanks to @vbaliga for [this helpful code](https://vbaliga.github.io/posts/2019-04-28-verify-that-r-packages-are-installed-and-loaded/)).

```{r packages, message=FALSE}
# Load psm3mkv itself
library(psm3mkv)

# Other packages
library(dplyr) # for data wrangling
library(boot) # for bootstrapping
library(ggsci) # for nice graphics
library(flexsurv) # for data to work
library(survival) # for data to work
# Install psm3mkv version 0.2 from github
require("remotes")
remotes::install_github("Merck/psm3mkv",
ref="v0.2",
build_vignettes=TRUE)

# First specify the packages of interest
packages = c("psm3mkv", "dplyr", "boot", "ggsci", "flexsurv", "survival")

# Now load or install & load all
package.check <- lapply(
packages,
FUN = function(x) {
if (!require(x, character.only = TRUE)) {
install.packages(x, dependencies = TRUE)
library(x, character.only = TRUE)
}
}
)
```

## Obtaining a suitable dataset
Expand Down
Loading