Skip to content

Commit

Permalink
edits to packge description and vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewphamilton committed Oct 4, 2023
1 parent f3e9b7f commit 99478a4
Show file tree
Hide file tree
Showing 14 changed files with 75 additions and 97 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added ._.DS_Store
Binary file not shown.
99 changes: 27 additions & 72 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Adapted from: https://github.com/ready4-dev/ready4class/runs/3657635374?check_suite_focus=true
# NOTE: This workflow is overkill for most R packages
# check-standard.yaml is likely a better choice
# usethis::use_github_action("check-standard") will install it.
#
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
Expand Down Expand Up @@ -29,85 +26,43 @@ jobs:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: '3.6'}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest", http-user-agent: "R/4.0.0 (ubuntu-20.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-latest, r: 'release'}
#- {os: windows-latest, r: '3.6'}
# - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest", http-user-agent: "R/4.0.0 (ubuntu-20.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
# - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
#- {os: ubuntu-20.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3 #
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}

# with:
# r-version: ${{ matrix.config.r }}
# http-user-agent: ${{ matrix.config.http-user-agent }}
# use-public-rspm: true
- uses: r-lib/actions/setup-tinytex@v2
- run: tlmgr --version
- uses: r-lib/actions/setup-pandoc@v2

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows' && !matrix.config.autobrew
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ matrix.config.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ matrix.config.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
pandoc-version: '2.17.1' # The pandoc version to download (if necessary) and use.
- run: echo "# Test" | pandoc -t html
# Addresses issue with incompatibility between libcurl4-gnutls-dev and libcurl4-openssl-dev
# Below fix is a customisation of approach outlined in https://github.com/r-hub/sysreqsdb/issues/77#issuecomment-620025428
- name: Install libraptor on Linux
if: runner.os == 'Linux'
run: |
sudo apt-get install libharfbuzz-dev
sudo apt-get install libfribidi-dev
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')
- name: Install system dependencies
if: runner.os == 'MacOS' && !matrix.config.autobrew
run: brew install harfbuzz fribidi

- name: Remove homebrew
if: matrix.config.autobrew
uses: autobrew/uninstall-homebrew@master

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
sudo add-apt-repository ppa:cran/librdf
sudo apt update
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::XML, any::rcmdcheck
needs: check
- uses: r-lib/actions/check-r-package@v2
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
args: 'c("--no-manual", "--as-cran")'
error-on: '"error"'
check-dir: '"check"'
10 changes: 10 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,22 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-tinytex@v2

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

# Addresses issue with incompatibility between libcurl4-gnutls-dev and libcurl4-openssl-dev
# Below fix is a customisation of approach outlined in https://github.com/r-hub/sysreqsdb/issues/77#issuecomment-620025428
- name: Install libraptor on Linux
if: runner.os == 'Linux'
run: |
sudo add-apt-repository ppa:cran/librdf
sudo apt update
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::XML, any::pkgdown, local::.
Expand Down
10 changes: 7 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ Imports:
VignetteBuilder: knitr
Depends:
R (>= 2.10),
specific
scorz (>= 0.0.0.9062),
specific (>= 0.0.0.9108)
LazyData: true
Collate:
'C4_TTUSynopsis.R'
Expand All @@ -71,9 +72,12 @@ Suggests:
betareg,
caret,
knitrBootstrap,
rmarkdown
rmarkdown,
youthvars (>= 0.0.0.9123)
Remotes:
ready4-dev/ready4,
ready4-dev/ready4show,
ready4-dev/ready4use,
ready4-dev/specific
ready4-dev/specific,
ready4-dev/youthvars,
ready4-dev/scorz
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@

<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![ready4](https://img.shields.io/badge/ready4-modelling-indigo?style=flat&labelColor=black&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAFzUkdCAK7OHOkAAAAEZ0FNQQAAsY8L/GEFAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAIXRFWHRDcmVhdGlvbiBUaW1lADIwMjI6MDM6MDcgMTY6MTM6NTPZeG5UAAABa0lEQVQ4T4WT607CQBCFpyUi3qIR0eAfNfCi/vENfEgENIAIlcJ6vr1oLaZOerJzdst0zpklc49nznqHZs6ZfWwDem1xM1sqXwtXkb8rL4SuOLEoLXPPXWfD01Dg9dPsrTQbngQ+EZ+LDyIfiy/FHyIfFZbbTslWKOOqxx/uWBPSfp07FahGlqlNfWGqL9HNfBO+CAfwdO55WS8g4MFML834sfJVA9e7vwsg50aGohncdmRojV9XeL+jArRNmZxVSJ4Acj3NHqARdyeFJqC2KJiCfKE9zsfxnNYTl5TcCtmNMcwY/ZXf+3wdzzVza2vj4iCaq3d1R/bvwVSH6IPjNIUHx0FSNZA7WquDqOVb35+eiO8h7Oe+vRfp0a3yGtFMDuiAIg2R20YaVwJ3Hj+4kehO/J/I7VJ/jHtpvBP6mrHnR4EzdyQ0xI8HhM8jUiChxVpDK3iVuadzx43yRdI4E2d0gNtX74TCs419AR8YEST/cHPBAAAAAElFTkSuQmCC)](https://www.ready4-dev.com/toolkits/)
[![ready4](https://img.shields.io/badge/ready4-modelling-indigo?style=flat&labelColor=black&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAFzUkdCAK7OHOkAAAAEZ0FNQQAAsY8L/GEFAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAIXRFWHRDcmVhdGlvbiBUaW1lADIwMjI6MDM6MDcgMTY6MTM6NTPZeG5UAAABa0lEQVQ4T4WT607CQBCFpyUi3qIR0eAfNfCi/vENfEgENIAIlcJ6vr1oLaZOerJzdst0zpklc49nznqHZs6ZfWwDem1xM1sqXwtXkb8rL4SuOLEoLXPPXWfD01Dg9dPsrTQbngQ+EZ+LDyIfiy/FHyIfFZbbTslWKOOqxx/uWBPSfp07FahGlqlNfWGqL9HNfBO+CAfwdO55WS8g4MFML834sfJVA9e7vwsg50aGohncdmRojV9XeL+jArRNmZxVSJ4Acj3NHqARdyeFJqC2KJiCfKE9zsfxnNYTl5TcCtmNMcwY/ZXf+3wdzzVza2vj4iCaq3d1R/bvwVSH6IPjNIUHx0FSNZA7WquDqOVb35+eiO8h7Oe+vRfp0a3yGtFMDuiAIg2R20YaVwJ3Hj+4kehO/J/I7VJ/jHtpvBP6mrHnR4EzdyQ0xI8HhM8jUiChxVpDK3iVuadzx43yRdI4E2d0gNtX74TCs419AR8YEST/cHPBAAAAAElFTkSuQmCC)](https://www.ready4-dev.com/docs/software/libraries/types/module/)
[![R-CMD-check](https://github.com/ready4-dev/TTU/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ready4-dev/TTU/actions/workflows/R-CMD-check.yaml)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5646593.svg)](https://doi.org/10.5281/zenodo.5646593)
<!-- badges: end -->

Tools for developing, reporting and sharing utility mapping
algorithms for use with the ready4 youth mental health systems model
(https://ready4-dev.github.io/ready4/). This development version of
the TTU package has been made available as part of the process of
testing and documenting the package. If you have any questions,
please contact the authors ([email protected]).
Modules from the ready4 youth mental health economic model
(https://www.ready4-dev.com/docs/model/) that can be used to develop,
assess, report and share utility mapping models. Outputs produced
through use of TTU package modules are designed to integrate with
health economic models developed with the ready4 framework
(https://www.ready4-dev.com/). This development version of the TTU
package has been made available as part of the process of testing and
documenting the package. If you have any questions, please contact
the authors ([email protected]).

To install a development version of this software, run the following commands in your R console:

Expand Down
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ home:
href: https://github.com/ready4-dev/TTU/releases/download/Documentation_0.0/TTU_User.pdf
- text: Manual - Developer (PDF)
href: https://github.com/ready4-dev/TTU/releases/download/Documentation_0.0/TTU_Developer.pdf
- text: Model
- text: Framework & Model
href: https://ready4-dev.github.io/ready4/
development:
mode: auto
Expand Down
8 changes: 7 additions & 1 deletion data-raw/DATASET.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
library(ready4)
library(ready4fun)
library(ready4use)
library(ready4show)
Expand All @@ -9,7 +10,8 @@ ready4fun::write_fn_type_dirs()
fns_env_ls <- ready4fun::read_fns(c("data-raw/fns/","data-raw/mthds/"),
fns_env = new.env(parent = globalenv()))
x <- ready4fun::make_pkg_desc_ls(pkg_title_1L_chr = "Implement Transfer to Utility Mapping Algorithms",
pkg_desc_1L_chr = "Tools for developing, reporting and sharing utility mapping algorithms for use with the ready4 youth mental health systems model (https://ready4-dev.github.io/ready4/).
pkg_desc_1L_chr = "Modules from the ready4 youth mental health economic model (https://www.ready4-dev.com/docs/model/) that can be used to develop, assess, report and share utility mapping models.
Outputs produced through use of TTU package modules are designed to integrate with health economic models developed with the ready4 framework (https://www.ready4-dev.com/).
This development version of the TTU package has been made available as part of the process of testing and documenting the package.
If you have any questions, please contact the authors ([email protected]).",
authors_prsn = c(utils::person(given = "Caroline",family = "Gao",email = "[email protected]", role = c("aut"),comment = c(ORCID = "0000-0002-0987-2759")),
Expand Down Expand Up @@ -197,6 +199,10 @@ usethis::use_dev_package("scorz",
usethis::use_dev_package("specific",
type = "Depends",
remote = "ready4-dev/specific")
write_to_edit_workflow("pkgdown.yaml", consent_1L_chr = "Y") # In other packages, run for "test-coverage.yaml" as well.
readLines("_pkgdown.yml") %>%
stringr::str_replace_all(" - text: Model", " - text: Framework & Model") %>%
writeLines(con = "_pkgdown.yml")
devtools::build_vignettes()
# usethis::use_package("readr")
# MANUAL DELETION OF TRAILING INCLUDE
Expand Down
Binary file modified data/mdl_types_lup.rda
Binary file not shown.
Binary file modified data/plt_types_lup.rda
Binary file not shown.
Binary file modified data/rprt_lup.rda
Binary file not shown.
4 changes: 2 additions & 2 deletions man/TTU-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vignettes/TTU.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ knitr::opts_chunk$set(
library(TTU)
```

The tools in TTU are designed to make it easier to implement utility mapping studies for with [ready4 - an open source health economic model of the systems shaping mental health and wellbeing in young people](https://www.ready4-dev.com).
The [ready4 framework model modules](https://www.ready4-dev.com/docs/framework/implementation/modularity/) in TTU are designed to make it easier to implement utility mapping studies for with [ready4 youth mental health economic model](https://www.ready4-dev.com/docs/model/) (or any other model developed with the [ready4 framework](https://www.ready4-dev.com)).

This development version of the TTU package has been made available as part of the process of testing and documenting the package. [Installation instructions are on the package homepage](https://ready4-dev.github.io/TTU/index.html). Currently, one vignette article is available to demonstrate how to use the TTU package:

Expand Down
20 changes: 10 additions & 10 deletions vignettes/V_01.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ vignette: >
%\VignetteEncoding{UTF-8}
---

Note: **This vignette uses fake data** - it is for illustrative purposes only and should not be used to inform decision making.
Note: **This vignette uses fake data** - it is for illustrative purposes only and should not be used to inform decision making. This vignette outlines the workflow for developing utility mapping models using longitudinal data. The workflow for developing utility mapping models is broadly similar, with some minor modifications. An example of developing models using cross-sectional data is available at https://doi.org/10.5281/zenodo.8098595 .

## Motivation

Youth mental health services do not typically collect health utility data from their clients, which makes it more difficult to place an economic values on outcomes attained in these services. One strategy for addressing this gap is to use data from similar samples of young people that contain both health utility and the types of outcome measures that are collected in clinical services. The TTU package provides a toolkit for conducting and reporting a utility mapping (or Transfer to Utility) study.
Health services do not typically collect health utility data from their clients, which makes it more difficult to place an economic values on outcomes attained in these services. One strategy for addressing this gap is to use data from similar samples of patients that contain both health utility and the types of outcome measures that are collected in clinical services. The TTU package provides a toolkit for conducting and reporting a utility mapping (or Transfer to Utility) study.

## Implementation
The TTU package contains [modules](https://www.ready4-dev.com/docs/framework/implementation/modularity/) of the [ready4 youth mental health economic model](https://www.ready4-dev.com/docs/model/) that combine and extend model modules for:

TTU has been developed for use with the [ready4 model](https://ready4-dev.github.io/ready4/) and combines and extends multiple types of [ready4 modules](https://ready4-dev.github.io/ready4/articles/V_01.html):

- Modules for labeling, validating and summarising youth mental health datasets from the [youthvars](https://ready4-dev.github.io/youthvars/) package;
- Modules for scoring health utility from the [scorz](https://ready4-dev.github.io/scorz/) package;
- Modules for specifying and testing statistical models from the [specific](https://ready4-dev.github.io/specific/) package;
- Modules for generating reports from the [ready4show](https://ready4-dev.github.io/ready4show/) package; and
- Modules for sharing data via online data repositories from the [ready4use](https://ready4-dev.github.io/ready4use/) package.
- labeling, validating and summarising youth mental health datasets (from the [youthvars](https://ready4-dev.github.io/youthvars/) package);
- scoring health utility (from the [scorz](https://ready4-dev.github.io/scorz/) package);
- specifying and testing statistical models (from the [specific](https://ready4-dev.github.io/specific/) package);
- generating reproducible analysis reports (from the [ready4show](https://ready4-dev.github.io/ready4show/) package); and
- sharing data via online data repositories (from the [ready4use](https://ready4-dev.github.io/ready4use/) package).

Additionally, TTU relies on two RMarkdown programs:

- ttu_mdl_ctlg: Generate a Template Utility Mapping (Transfer to Utility) Model Catalogue (https://doi.org/10.5281/zenodo.5936870)
- ttu_lng_ss: Create a Draft Scientific Manuscript For A Utility Mapping Study (https://doi.org/10.5281/zenodo.5976987)

Outputs generated by the TTU package are designed to be compatible with health economic models developed with the [ready4 framework](https://www.ready4-dev.com)).

## Workflow
### Background and citation
Expand Down Expand Up @@ -108,7 +108,7 @@ A <- Ready4useDyad(ds_tb = Ready4useRepos(dv_nm_1L_chr = "fakes", dv_ds_nm_1L_ch
renew(type_1L_chr = "label")
```

We use the YouthvarsSeries module to [supply metadata about out a longitudinal dataset vignette](https://ready4-dev.github.io/youthvars/articles/V_02.html).
We use the YouthvarsSeries module to [supply metadata about our longitudinal dataset vignette](https://ready4-dev.github.io/youthvars/articles/V_02.html).

```{r}
A <- YouthvarsSeries(a_Ready4useDyad = A, id_var_nm_1L_chr = "fkClientID", timepoint_var_nm_1L_chr = "round",
Expand Down

0 comments on commit 99478a4

Please sign in to comment.