-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
482fcb1
commit 50292cf
Showing
15 changed files
with
335 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#' | ||
#' Manufacture a new object | ||
#' @name manufacture-TTUProject | ||
#' @description manufacture method applied to TTUProject | ||
#' @param x An object of class TTUProject | ||
#' @param type_1L_chr Type (a character vector of length one), Default: 'dummys' | ||
#' @param what_1L_chr What (a character vector of length one), Default: 'factors' | ||
#' @param ... Additional arguments | ||
#' @return Object (an output object of multiple potential types) | ||
#' @rdname manufacture-methods | ||
#' @aliases manufacture,TTUProject-method | ||
#' @export | ||
#' @importFrom ready4 manufacture | ||
methods::setMethod("manufacture", "TTUProject", function (x, type_1L_chr = "dummys", what_1L_chr = "factors", | ||
...) | ||
{ | ||
object_xx <- manufacture(x@c_SpecificProject@a_YouthvarsProfile@a_Ready4useDyad, | ||
type_1L_chr = type_1L_chr, what_1L_chr = what_1L_chr, | ||
restrict_to_chr = x@c_SpecificProject@b_SpecificParameters@candidate_covars_chr) | ||
return(object_xx) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#' | ||
#' Procure items from a dataset | ||
#' @name procure-TTUProject | ||
#' @description procure method applied to TTUProject | ||
#' @param x An object of class TTUProject | ||
#' @param type_1L_chr Type (a character vector of length one), Default: 'default' | ||
#' @param variables_chr Variables (a character vector), Default: character(0) | ||
#' @param what_1L_chr What (a character vector of length one), Default: 'records' | ||
#' @param ... Additional arguments | ||
#' @return Object (an output object of multiple potential types) | ||
#' @rdname procure-methods | ||
#' @aliases procure,TTUProject-method | ||
#' @export | ||
#' @importFrom dplyr select | ||
#' @importFrom ready4 procure | ||
methods::setMethod("procure", "TTUProject", function (x, type_1L_chr = "default", variables_chr = character(0), | ||
what_1L_chr = "records", ...) | ||
{ | ||
if (what_1L_chr == "parameters") { | ||
if (type_1L_chr == "models_lup") { | ||
object_xx <- x@b_SpecificParameters@candidate_mdls_lup | ||
} | ||
} | ||
if (what_1L_chr %in% c("project")) { | ||
if (type_1L_chr == "models") { | ||
object_xx <- procureSlot(x, "c_SpecificProject", | ||
use_procure_mthd_1L_lgl = T, what_1L_chr = "prefd_mdls") | ||
} | ||
} | ||
if (what_1L_chr %in% c("profile", "records")) { | ||
object_xx <- x@a_ScorzProfile@a_YouthvarsProfile | ||
if (!identical(variables_chr, character(0))) { | ||
object_xx@a_Ready4useDyad@ds_tb <- object_xx@a_Ready4useDyad@ds_tb %>% | ||
dplyr::select(variables_chr) | ||
} | ||
if (what_1L_chr == "records") { | ||
if (type_1L_chr %in% c("default")) { | ||
object_xx <- object_xx@a_Ready4useDyad@ds_tb | ||
} | ||
} | ||
} | ||
return(object_xx) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,42 @@ | ||
exhibit_TTUProject <- function(x, | ||
captions_chr = NULL, | ||
display_1L_chr = "all", | ||
header_1L_chr = "", | ||
header_col_nms_chr = " ", | ||
mkdn_tbl_refs_chr = NULL, | ||
profile_idx_int = NA_integer_, | ||
output_type_1L_chr = "HTML", | ||
type_1L_chr = "default", | ||
use_lbls_as_col_nms_1L_lgl = T, | ||
use_rdocx_1L_lgl = F, | ||
variables_chr = character(0), | ||
what_1L_chr = "predictors", | ||
...){ | ||
if(what_1L_chr == "predictors"){ | ||
exhibitSlot(x, "b_SpecificParameters@predictors_lup", | ||
... = ...) | ||
} | ||
|
||
if(what_1L_chr == "profile"){ | ||
exhibit(procure(x, variables_chr = variables_chr, type_1L_chr == "default", what_1L_chr = what_1L_chr, ...=...), | ||
captions_chr = captions_chr, | ||
header_1L_chr = header_1L_chr, | ||
header_col_nms_chr = header_col_nms_chr, | ||
mkdn_tbl_refs_chr = mkdn_tbl_refs_chr, | ||
profile_idx_int = profile_idx_int, | ||
output_type_1L_chr = output_type_1L_chr, | ||
what_1L_chr = type_1L_chr) #descriptives | ||
} | ||
if(what_1L_chr == "records"){ | ||
if(type_1L_chr %in% c("ds","dict")){ | ||
exhibit(x@a_ScorzProfile@a_YouthvarsProfile@a_Ready4useDyad, | ||
caption_1L_chr = {if(is.null(captions_chr)){NA_character_}else{captions_chr[1]}}, | ||
display_1L_chr = display_1L_chr, | ||
mkdn_tbl_ref_1L_chr = {if(is.null(mkdn_tbl_refs_chr)){""}else{mkdn_tbl_refs_chr[1]}}, | ||
output_type_1L_chr = "HTML", | ||
type_1L_chr = type_1L_chr, | ||
use_lbls_as_col_nms_1L_lgl = T, | ||
use_rdocx_1L_lgl = F, | ||
... = ...) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
manufacture_TTUProject <- function(x, | ||
type_1L_chr = "dummys", | ||
what_1L_chr = "factors", | ||
...){ | ||
object_xx <- manufacture(x@c_SpecificProject@a_YouthvarsProfile@a_Ready4useDyad, type_1L_chr = type_1L_chr, what_1L_chr = what_1L_chr, | ||
restrict_to_chr = x@c_SpecificProject@b_SpecificParameters@candidate_covars_chr) | ||
return(object_xx) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
procure_TTUProject <- function(x, | ||
type_1L_chr = "default", | ||
variables_chr = character(0), | ||
what_1L_chr = "records", | ||
...){ | ||
if(what_1L_chr == "parameters"){ | ||
if(type_1L_chr == "models_lup"){ | ||
object_xx <- x@b_SpecificParameters@candidate_mdls_lup | ||
} | ||
} | ||
if(what_1L_chr %in% c("project")){ | ||
if(type_1L_chr == "models"){ | ||
object_xx <- procureSlot(x,"c_SpecificProject", use_procure_mthd_1L_lgl = T, what_1L_chr = "prefd_mdls") | ||
} | ||
} | ||
if(what_1L_chr %in% c("profile", "records")){ | ||
object_xx <- x@a_ScorzProfile@a_YouthvarsProfile | ||
if(!identical(variables_chr, character(0))){ | ||
object_xx@a_Ready4useDyad@ds_tb <- object_xx@a_Ready4useDyad@ds_tb %>% dplyr::select(variables_chr) | ||
} | ||
if(what_1L_chr == "records"){ | ||
if(type_1L_chr %in% c("default")){ | ||
object_xx <- object_xx@a_Ready4useDyad@ds_tb | ||
} | ||
} | ||
} | ||
return(object_xx) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.