Skip to content

Commit

Permalink
updated dpcys
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewphamilton committed Apr 22, 2024
1 parent 7f54380 commit 9dafd8f
Show file tree
Hide file tree
Showing 16 changed files with 106 additions and 51 deletions.
10 changes: 6 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ Description: Tools for mapping measures routinely collected in youth
youthu 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]).
License: GPL-3 + file LICENSE
License: GPL-3
URL: https://ready4-dev.github.io/youthu/,
https://github.com/ready4-dev/youthu, https://www.ready4-dev.com/
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
Suggests:
knitr,
pkgload,
rmarkdown,
scorz,
scorz (>= 0.0.0.9065),
testthat
VignetteBuilder: knitr
Imports:
Expand Down Expand Up @@ -57,7 +58,8 @@ Imports:
Depends:
R (>= 2.10)
LazyData: true
Remotes:
Remotes:
ready4-dev/ready4use,
ready4-dev/specific,
ready4-dev/youthvars
ready4-dev/youthvars,
ready4-dev/scorz
15 changes: 0 additions & 15 deletions LICENSE

This file was deleted.

4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Generated by roxygen2: do not edit by hand

export("%>%")
export(":=")
export(.data)
export(add_change_in_ds_var)
export(add_costs_by_tmpt)
export(add_costs_from_gamma_dstr)
Expand Down Expand Up @@ -97,6 +99,8 @@ importFrom(ready4,get_from_lup_obj)
importFrom(ready4,ingest)
importFrom(ready4use,Ready4useRepos)
importFrom(ready4use,add_labels_from_dictionary)
importFrom(rlang,":=")
importFrom(rlang,.data)
importFrom(rlang,exec)
importFrom(rlang,sym)
importFrom(specific,add_utl_predn_to_new_ds)
Expand Down
36 changes: 32 additions & 4 deletions R/imp_fns.R
Original file line number Diff line number Diff line change
@@ -1,23 +1,51 @@
#' Pipe operator
#'
#' Implements: https://github.com/sckott/analogsea/issues/32
#' and https://github.com/rstudio/ggvis/blob/master/R/pipe.R.
#' Import of [magrittr::%>%()]. See magrittr package documentation for detailed description.
#'
#' @importFrom magrittr %>%
#' @name %>%
#' @rdname pipe
#' @export
#' @param lhs,rhs An object and a function to apply to it
#' @keywords internal
#' @returns The type of return from this function depends on the left hand side and right hand side arguments supplied to it. In principle, any type of returned object is feasible.
#' @seealso [magrittr::%>%()]
NULL

#' Deprecated function
#'
#' Import of deprecated function as recommended in lifecycle package documentation.
#' Import of [lifecycle::deprecated()]. See lifecycle package documentation for detailed description.
#'
#' @importFrom lifecycle deprecated
#' @name deprecated
#' @rdname deprecated
#' @export
#' @keywords internal
#' @returns Does not return a value as the function is used to signal that a function argument has been deprecated.
#' @seealso [lifecycle::deprecated()]
NULL

#' Non standard evaluation assignment function
#'
#' Import of := function, implementing [rlang::dyn-dots()]. See rlang package documentation for detailed description.
#'
#' @importFrom rlang :=
#' @name :=
#' @rdname nseequals
#' @export
#' @keywords internal
#' @returns Does not return a value. Used to implement non standard evaluation within a dynamic dots context.
#' @seealso [rlang::dyn-dots()]
NULL

#' Dot Data function
#'
#' Import of [rlang::.data()]. See rlang package documentation for detailed description.
#'
#' @importFrom rlang .data
#' @name .data
#' @rdname dotdata
#' @export
#' @keywords internal
#' @returns Does not return a value. A pronoun for use in data-masked functions.
#' @seealso [rlang::.data()]
NULL
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

Tools for mapping measures routinely collected in youth
mental health services to Quality Adjusted Life Years (QALYs). Part of
the ready4 youth mental health systems model
(https://www.ready4-dev.com/docs/model/). This development version of
the youthu package has been made available as part of the process of
the ready4forwhatsnext youth mental health systems model
(https://readyforwhatsnext.org/). This development version of the
youthu 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]).

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/youthu/releases/download/Documentation_0.0/youthu_User.pdf
- text: Manual - Developer (PDF)
href: https://github.com/ready4-dev/youthu/releases/download/Documentation_0.0/youthu_Developer.pdf
- text: Framework and Model
- text: Model
href: https://www.ready4-dev.com/
development:
mode: auto
Expand Down
19 changes: 9 additions & 10 deletions data-raw/DATASET.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
library(ready4)
library(ready4show)
library(ready4use)
library(ready4fun)
library(youthvars)
library(scorz)
library(specific)
Expand All @@ -10,9 +11,9 @@ 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 = "Transform Youth Outcomes to Health Utility Predictions" %>% tools::toTitleCase(),
pkg_desc_1L_chr = "Tools for mapping measures routinely collected in youth mental health services to Quality Adjusted Life Years (QALYs). Part of the ready4 youth mental health systems model (https://www.ready4-dev.com/docs/model/).
pkg_desc_1L_chr = "Tools for mapping measures routinely collected in youth mental health services to Quality Adjusted Life Years (QALYs). Part of the ready4forwhatsnext youth mental health systems model (https://readyforwhatsnext.org/).
This development version of the youthu 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 = "Matthew",family = "Hamilton",email = "[email protected]", role = c("aut", "cre"),comment = c(ORCID = "0000-0001-7407-9194")),
authors_prsn = c(utils::person(given = "Matthew",family = "Hamilton",email = "[email protected]", role = c("aut", "cre", "cph"),comment = c(ORCID = "0000-0001-7407-9194")),
utils::person(given = "Caroline",family = "Gao",email = "[email protected]", role = c("aut"),comment = c(ORCID = "0000-0002-0987-2759")),
utils::person("Orygen", role = c("cph", "fnd")),
utils::person("Headspace", role = c( "fnd")),
Expand All @@ -24,7 +25,7 @@ x <- ready4fun::make_pkg_desc_ls(pkg_title_1L_chr = "Transform Youth Outcomes to
suggests_chr = c("knitr","rmarkdown", "scorz")),
build_ignore_ls = ready4fun::make_build_ignore_ls(file_nms_chr = c("initial_setup.R")),
check_type_1L_chr = "ready4",
copyright_holders_chr = "Orygen",
copyright_holders_chr = "Matthew Hamilton and Orygen",
custom_dmt_ls = ready4fun::make_custom_dmt_ls(user_manual_fns_chr = c("add_utl_predn",
"add_qalys_to_ds",
"get_mdl_from_dv",
Expand All @@ -34,7 +35,7 @@ x <- ready4fun::make_pkg_desc_ls(pkg_title_1L_chr = "Transform Youth Outcomes to
"make_sngl_grp_ds",
"make_matched_ds",
"rename_from_nmd_vec")),##
dev_pkgs_chr = c("ready4",
dev_pkgs_chr = c(#"ready4",
"ready4use","ready4show",
"scorz", "specific",
"youthvars"),
Expand All @@ -58,12 +59,10 @@ z <- ready4::author(z)
usethis::use_dev_package("scorz", type = "Suggests", remote = "ready4-dev/scorz")
ready4::write_extra_pkgs_to_actions(path_to_dir_1L_chr = ".github/workflows", consent_1L_chr = "Y")
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()
# ready4::write_citation_cff(packageDescription("youthu"),
# citation_chr = readLines("inst/CITATION"))
write_to_tidy_pkg(z$x_ready4fun_manifest, build_vignettes_1L_lgl = TRUE,
clean_license_1L_lgl = TRUE, consent_1L_chr = "Y",
examples_chr = character(0),
suggest_chr = "pkgload")
# usethis::use_dev_package("TTU",
# type = "Depends",
# remote = "ready4-dev/TTU")
Expand Down
4 changes: 2 additions & 2 deletions inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ bibentry(
bibtype = "Manual",
doi = "10.5281/zenodo.5646668",
title = paste0(meta$Package,": ",meta$Title),
author = c(person("Matthew Hamilton <[email protected]> [aut, cre]", "(<https://orcid.org/0000-0001-7407-9194>)"), person("Caroline Gao <[email protected]> [aut]", "(<https://orcid.org/0000-0002-0987-2759>)")),
author = c(person("Matthew Hamilton <[email protected]> [aut, cre, cph]", "(<https://orcid.org/0000-0001-7407-9194>)"), person("Caroline Gao <[email protected]> [aut]", "(<https://orcid.org/0000-0002-0987-2759>)")),
year = "2024",
note = sprintf("R package version %s", meta$Version),
url = "https://ready4-dev.github.io/youthu/",
textVersion = paste("Matthew Hamilton <[email protected]> [aut, cre] (<https://orcid.org/0000-0001-7407-9194>) and Caroline Gao <[email protected]> [aut] (<https://orcid.org/0000-0002-0987-2759>) ",
textVersion = paste("Matthew Hamilton <[email protected]> [aut, cre, cph] (<https://orcid.org/0000-0001-7407-9194>) and Caroline Gao <[email protected]> [aut] (<https://orcid.org/0000-0002-0987-2759>) ",
"(2024).",
paste0(meta$Package,": ",meta$Title,
"."),
Expand Down
8 changes: 7 additions & 1 deletion man/deprecated.Rd

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

15 changes: 15 additions & 0 deletions man/dotdata.Rd

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

15 changes: 15 additions & 0 deletions man/nseequals.Rd

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

10 changes: 6 additions & 4 deletions man/pipe.Rd

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

7 changes: 3 additions & 4 deletions man/youthu-package.Rd

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

3 changes: 2 additions & 1 deletion vignettes/Prediction_With_Mdls.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ This vignette outlines a workflow for:
- Preparing a prediction dataset for use with a selected transfer to utility model; and
- Applying the selected transfer to utility model to a prediction dataset to predict Quality Adjusted Life Years (QALYs).

The practical value of implementing such a workflow is discussed in the [economic analysis vignette](https://ready4-dev.github.io/youthu/articles/Economic_Analysis.html) and [a scientific manuscript](https://www.medrxiv.org/content/10.1101/2021.07.07.21260129v2.full). Note, this example uses fake data - it should should not be used to inform decision making.
The practical value of implementing such a workflow is discussed in the [economic analysis vignette](https://ready4-dev.github.io/youthu/articles/Economic_Analysis.html) and [a scientific manuscript](
https://www.medrxiv.org/content/10.1101/2021.07.07.21260129v4). Note, this example uses fake data - it should should not be used to inform decision making.

## Search, select and retrieve transfer to utility models
To identify datasets that contain transfer to utility models compatible with youthu (ie those developped with the [TTU package](https://ready4-dev.github.io/TTU/index.html)), you can use the `get_ttu_dv_dss` function. The function searches specified dataverses (in the below example, the [TTU dataverse](https://dataverse.harvard.edu/dataverse/TTU)) for datasets containing output from the TTU package.
Expand Down
1 change: 0 additions & 1 deletion vignettes/V_01.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ data_tb <- transform_ds_to_drop_msng(data_tb, predictors_chr = c("gad7", "phq9")
uid_var_nm_1L_chr = "fkClientID")
```


We now predict AQoL-6D health utility for each case with complete data.

```{r}
Expand Down
2 changes: 1 addition & 1 deletion vignettes/youthu.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ knitr::opts_chunk$set(
```{r setup}
library(youthu)
```
The tools in youthu are designed to make it easier to predict health utility with the [ready4 health economic model](https://www.ready4-dev.com/docs/model/).
The tools in youthu are designed to make it easier to predict health utility with the [readyforwhatsnext health economic model](https://readyforwhatsnext.org/).

This development version of the youthu package has been made available as part of the process of testing and documenting the package.

Expand Down

0 comments on commit 9dafd8f

Please sign in to comment.