diff --git a/DESCRIPTION b/DESCRIPTION index 8374719..50fb07e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: struct Type: Package Title: Statistics in R Using Class-based Templates -Version: 1.15.2 +Version: 1.15.3 Authors@R: c( person( c("Gavin","Rhys"), @@ -49,7 +49,8 @@ Collate: 'resampler_class.R' 'struct.R' 'struct_templates.R' -RoxygenNote: 7.1.2 + 'zzz.R' +RoxygenNote: 7.2.3 Depends: R (>= 4.0) Suggests: testthat, diff --git a/NAMESPACE b/NAMESPACE index c164317..3648a37 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -14,6 +14,7 @@ export("output_value<-") export("param_list<-") export("param_obj<-") export("param_value<-") +export(.struct_class) export(DatasetExperiment) export(as.DatasetExperiment) export(as.SummarizedExperiment) @@ -31,6 +32,7 @@ export(enum_stato) export(example_chart) export(example_iterator) export(example_model) +export(get_description) export(iris_DatasetExperiment) export(is_output) export(is_param) diff --git a/R/generics.R b/R/generics.R index c975cc7..bcdf649 100644 --- a/R/generics.R +++ b/R/generics.R @@ -230,8 +230,7 @@ setGeneric("output_list<-",function(obj,value)standardGeneric("output_list<-")) #' #' Returns a list of valid charts for a struct object #' -#' The chart_names method searches chart objects that specify the input object -#' type as an input. +#' The chart_names method searches for chart objects associated with the unput object. #' #' @param obj An object derived from the struct_class object #' @param ret A string indicating whether a list of objects ('obj') or a list of chart diff --git a/R/iterator_class.R b/R/iterator_class.R index b78c59a..4468e77 100644 --- a/R/iterator_class.R +++ b/R/iterator_class.R @@ -229,7 +229,7 @@ setMethod(f = 'show', signature = c('iterator'), definition = function(object) { callNextMethod() - + if (is(models(object),'model_seq')) { cat('models: ','a model_seq with ', length(models(object)),' steps\n',sep='') } else { @@ -251,9 +251,11 @@ setMethod(f = 'as.code', definition = function(M,start='M = ',mode='compact',quiet=FALSE) { str=.as_code(M,start,mode) # get models - m=models(M) - # if iterator then multiply - str=paste0(str,' * \n') + m = models(M) + # if iterator then multiply, if not default model + if (class(m)[1]!='model') { + str=paste0(str,' * \n') + } if (is(m,'model_seq') & length(m) > 1) { if (mode=='expanded') { str=paste0(str,paste0(paste0(rep(' ',nchar(start)),collapse=''),'(\n')) @@ -266,14 +268,14 @@ setMethod(f = 'as.code', } str=paste0(str,')') - } else { + } else if (class(m)[1]!='model') { str=paste0(str,as.code(m,start=paste0(rep(' ',nchar(start)),collapse=''),mode,quiet=TRUE)) } - + if (!quiet){ cat(str) } - + invisible(str) } ) @@ -288,7 +290,7 @@ setMethod(f = 'as.code', .DollarNames.struct_class(x,pattern) } -#' @export +#' @export #' @rdname autocompletion setMethod('.DollarNames','iterator',.DollarNames.iterator) diff --git a/R/output_class.R b/R/output_class.R index 88df407..70ad5b5 100644 --- a/R/output_class.R +++ b/R/output_class.R @@ -1,6 +1,6 @@ #' @include generics.R struct_class.R #' -#' @describeIn output_obj +#' @rdname output_obj #' @export setMethod(f = "output_obj", signature = c("struct_class","character"), @@ -10,7 +10,7 @@ setMethod(f = "output_obj", } ) -#' @describeIn output_obj +#' @rdname output_obj #' @export #' @return the modified object setMethod(f = "output_obj<-", @@ -24,7 +24,7 @@ setMethod(f = "output_obj<-", } ) -#' @describeIn is_output +#' @rdname is_output #' @export setMethod(f = "is_output", signature = c("struct_class"), @@ -38,7 +38,7 @@ setMethod(f = "is_output", } ) -#' @describeIn output_ids +#' @rdname output_ids #' @export setMethod(f = "output_ids", signature = c("struct_class"), @@ -62,7 +62,7 @@ setMethod(f = "output_ids", } ) -#' @describeIn output_name +#' @rdname output_name #' @export setMethod(f = "output_name", signature = c("struct_class",'character'), @@ -79,7 +79,7 @@ setMethod(f = "output_name", } ) -#' @describeIn output_list +#' @rdname output_list #' @export setMethod(f = 'output_list', signature = c('struct_class'), @@ -93,7 +93,7 @@ setMethod(f = 'output_list', } ) -#' @describeIn output_list +#' @rdname output_list #' @export setMethod(f = 'output_list<-', signature = c('struct_class','list'), @@ -106,7 +106,7 @@ setMethod(f = 'output_list<-', } ) -#' @describeIn output_value +#' @rdname output_value #' @export setMethod(f = "output_value", signature = c("struct_class","character"), @@ -125,7 +125,7 @@ setMethod(f = "output_value", ) -#' @describeIn output_value +#' @rdname output_value #' @export setMethod(f = "output_value<-", signature = c("struct_class","character"), diff --git a/R/parameter_class.R b/R/parameter_class.R index 38a4c8a..56bb5eb 100644 --- a/R/parameter_class.R +++ b/R/parameter_class.R @@ -25,7 +25,7 @@ setMethod(f = "param_obj", #' @export -#' @describeIn is_param +#' @rdname is_param setMethod(f = "is_param", signature = c("struct_class"), definition = function(obj,name) { @@ -39,7 +39,7 @@ setMethod(f = "is_param", ) #' @export -#' @describeIn param_ids +#' @rdname param_ids setMethod(f = "param_ids", signature = c("struct_class"), definition = function(obj) { @@ -65,7 +65,7 @@ setMethod(f = "param_ids", #' @export -#' @describeIn param_name +#' @rdname param_name setMethod(f = "param_name", signature = c("struct_class",'character'), definition = function(obj,name) { @@ -82,7 +82,7 @@ setMethod(f = "param_name", ) #' @export -#' @describeIn param_list +#' @rdname param_list setMethod(f = 'param_list', signature = c('struct_class'), definition = function(obj) { @@ -96,7 +96,7 @@ setMethod(f = 'param_list', ) #' @export -#' @describeIn param_list +#' @rdname param_list setMethod(f = 'param_list<-', signature = c('struct_class','list'), definition = function(obj,value) { @@ -109,7 +109,7 @@ setMethod(f = 'param_list<-', ) #' @export -#' @describeIn param_value +#' @rdname param_value setMethod(f = "param_value", signature = c("struct_class","character"), definition = function(obj,name) { @@ -128,7 +128,7 @@ setMethod(f = "param_value", ) #' @export -#' @describeIn param_value +#' @rdname param_value setMethod(f = "param_value<-", signature = c("struct_class","character","ANY"), definition = function(obj,name,value) { diff --git a/R/struct_class.R b/R/struct_class.R index 15610de..d83fd54 100644 --- a/R/struct_class.R +++ b/R/struct_class.R @@ -226,8 +226,8 @@ setMethod(f = "$<-", } ) -#' @describeIn chart_names #' @export +#' @rdname chart_names setMethod(f = "chart_names", signature = c("struct_class"), definition = function(obj,ret = 'char') { @@ -647,7 +647,7 @@ setMethod('.DollarNames','struct_class',.DollarNames.struct_class) setMethod(f = 'as.code', signature = c('struct_class'), definition = function(M,start = 'M = ',mode = 'compact',quiet=FALSE) { - str=.as_code(M,start,mode) + str=struct:::.as_code(M,start,mode) if (!quiet) { cat(str) @@ -664,9 +664,9 @@ setMethod(f = 'as.code', if (!(mode %in% c('compact','neat','expanded','full'))) { stop(paste0('unknown option "', mode , '" for as.code()')) } - str=start + str = start # model object name - str=paste0(str,class(M)[1],'(') + str = paste0(str,class(M)[1],'(') # parameters P = param_ids(M) @@ -679,9 +679,13 @@ setMethod(f = 'as.code', } # add predicted if its not the default if (is(M,'model')) { - N=new_struct(class(M)[1]) + N = new_struct(class(M)[1]) + if (length(predicted_name(N))==0) { - N@predicted='cake' + N@predicted='not specified' + } + if (length(predicted_name(M))==0) { + M@predicted='not specified' } if (predicted_name(N) != predicted_name(M) | mode=='full') { @@ -689,7 +693,10 @@ setMethod(f = 'as.code', } } - if (mode != "compact") { + if ((mode=='neat' | mode=='expanded') & length(P)==0) { + str=paste0(str) + indent=nchar(start)+2 + } else if (mode != "compact") { str=paste0(str,'\n') indent=nchar(start)+2 } else { @@ -753,5 +760,9 @@ setMethod(f = 'as.code', } } + if (length(P)==0) { + str=paste0(str,')') + } + return(str) } diff --git a/R/zzz.R b/R/zzz.R new file mode 100644 index 0000000..e7f4120 --- /dev/null +++ b/R/zzz.R @@ -0,0 +1,204 @@ +#' Get struct object help description +#' +#' This +#' function is to help developers including struct objects in their own R +#' packages, and isnt intended for general use. +#' Use with roxygen 2 `@eval` tags this function generates a detailed +#' description of a struct object generated by extracting names, +#' descriptions etc from slots in a suitable format. +#' +#' @param id (character) the name of a struct object to generate documentation for +#' @return a character string of roxygen formatted documentation for the object +#' @examples +#' get_description('example_model') +#' +#' @export +get_description=function(id) { + + # object template + M=new_struct(id) + + # title + str=paste0('@title ', M$name) + + # get description + str=c(str,paste0('@description ',M$description)) + + # add inheritance + i=.class2(M) + w=which(i=='struct_class') + str = c(str, + '@section ','Inheritance: ', + paste0('A `', class(M), + '` object inherits the following `struct` classes: \\cr\\cr'), + paste0('`',i[1:w],'()`',collapse = ' \U2B62 ')) + + + # citations + cits=citations(M) + cits[length(cits)]=NULL + for (k in seq_along(cits)) { + cit=format(cits[[k]],style='text') + str=c(str,paste0('@references ',cit)) + } + + # get libraries + if (length(M$libraries)>0) { + str2=paste0('@details ', + 'This object makes use of functionality from the following packages:', + '\\itemize{ ' + ) + for (k in seq_along(M$libraries)) { + str2=paste0(str2,' \\item{\\code{',M$libraries[k],'}}') + } + str2=paste0(str2,'}') + str=c(str,str2) + } + + # parameters + P=formals(id) + + # for each parameter generate some text + D=list() + for (k in seq_along(P)) { + + # skip if ellipsis + if (names(P)[k]=='...') { + D[[k]]= paste0('@param ',names(P)[k], + ' Additional slots and values passed to \\code{struct_class}.') + next + } + #g=param_obj(M,names(P)[k]) + + D[[k]]=stringify_params(M,names(P)[k],type='param',val=P[[k]]) + } + str=c(str,D) + + # add outputs and descriptions to value + O = output_list(M) + + D=list() + for (k in seq_along(O)) { + D[[k]]=stringify_params(M,names(O)[k],type='output',val=O[[k]]) + } + + if (length(D)>0){ + str=c(str, + paste0('@return ','A \\code{', class(M)[1],'} object with the following \\code{output} slots:' ), + '\\tabular{ll}{', + D, + '}') + } else{ + str=c(str,'@return ','A \\code{', class(M)[1],'} object. This object has no \\code{output} slots.') + if (is(M,'chart')) { + str=c(str, 'See \\code{\\link[struct]{chart_plot}} in the \\code{struct} package to plot this chart object.') + } + + } + + # basic example + eg = '@examples' + cd = as.code(M,mode='neat',quiet=TRUE) + cd = gsub('[a list]','list()',cd,fixed = TRUE) + cd = gsub('[a function]','function(){}',cd,fixed = TRUE) + cd = gsub('[a annotation_database]','annotation_database()',cd,fixed = TRUE) + cd = gsub('[a logical]','FALSE',cd,fixed = TRUE) + cd = gsub('[a data.frame]','data.frame(id=NA)',cd,fixed = TRUE) + str=c(str,eg,cd,'') + + + return(unlist(str)) +} + + + +# in internal function used by get_desciption +stringify_params = function(M,P,type='param',val=NULL) { + + # get parameter as an object + if (type=='param') { + p = param_obj(M,P) + } else { + p=output_obj(M,P) + } + + # if its an entity object then get its description + if (is(p,'entity')) { + d = p$description + # ensure first character is upper case and last character is a fullstop. + d=unlist(lapply(d,function(x){ + # first is upper + substr(x,1,1) = toupper(substr(x,1,1)) + # last is . + if (substr(x,nchar(x),nchar(x)) != '.') { + x=paste0(x,'.') + } + return(x) + })) + + # if d has more than one entry and is a named vector then... + if (length(d)>1) { + # if it has names then + if (!is.null(names(d))) { + # create a named list + it_list='\\itemize{ ' + for (j in seq_along(d)) { + it_list=paste0(it_list,'\\item{\\code{"',names(d)[j],'"}: ',d[j],'}') + } + } else { + # no names so use a bulleted list + it_list='\\itemize{' + for (j in seq_along(d)) { + it_list=paste0(it_list,'\\item{',d[j],'}') + } + } + + # add list + it_list=paste0(it_list,'}') + d=paste0(p$name,'. Allowed values are limited to the following: ',it_list) + } + + # add the allowed types + t = p$type + + } else { + # if not an entity then there is no description + d = '' + t=class(val)[[1]] + } + # collapse if more than 1 + t=paste0(t,collapse=', ') + # enclose in brackets + t=paste0('(',t,') ') + # add to description + d=paste0(t,d) + + # if the parameter has a default, then add on the text. + if ( (!is(val,'name')) & type=='param'){ + d=paste0(d, ' The default is ') + if (length(val)>1 & !is.call(val)) { + d=paste0(d,'\\code{',capture.output(val)[1],'}.') + } else { + if (is.null(val)) { + d=paste0(d,'\\code{NULL}.') + } else if (is(val,'character')) { + d=paste0(d,'\\code{"',val,'"}.') + } else if (is.function(val) | is.call(val)) { + d=paste0(d,'\\code{',gsub('}','\\}', + paste0(trimws(deparse(val)),collapse='')),'}.') + #d=paste0(d,'\\code{some_function()}.') + } else { + + d=paste0(d,'\\code{',val,'}.\\cr') + } + } + } else { + # no default is provided + } + if (type=='param') { + OUT=paste0('@', type, ' ', P, ' ', d) + } else { + OUT=paste0('\\code{',P,'} \\tab ',d,' \\cr') + } +} + diff --git a/man/as.DatasetExperiment.Rd b/man/as.DatasetExperiment.Rd index aa40113..68f52b3 100644 --- a/man/as.DatasetExperiment.Rd +++ b/man/as.DatasetExperiment.Rd @@ -13,7 +13,7 @@ as.DatasetExperiment(obj) a DatasetExperiment object } \description{ -Converts a SummarizedExperiment to DatasetExperiment. The assay data is +Converts a SummarizedExperiment to DatasetExperiment. The assay data is transposed, and colData and rowData switched to match. struct specific slots such as "name" and "description" are extracted from the metaData. } diff --git a/man/as.SummarizedExperiment.Rd b/man/as.SummarizedExperiment.Rd index 33da13c..51a8019 100644 --- a/man/as.SummarizedExperiment.Rd +++ b/man/as.SummarizedExperiment.Rd @@ -13,7 +13,7 @@ as.SummarizedExperiment(obj) a SummarizedExperiment object } \description{ -Converts a DatasetExperiment to SummarizedExperiment. The assay data is +Converts a DatasetExperiment to SummarizedExperiment. The assay data is transposed, and colData and rowData switched to match. struct specific slots such as "name" and "description" are stored in the metaData. } diff --git a/man/cash-set-struct_class-method.Rd b/man/cash-set-struct_class-method.Rd index d351a68..604d527 100644 --- a/man/cash-set-struct_class-method.Rd +++ b/man/cash-set-struct_class-method.Rd @@ -17,7 +17,7 @@ Parameter/output value } \description{ -Dollar syntax can be used to as a shortcut for getting/setting input parameter +Dollar syntax can be used to as a shortcut for getting/setting input parameter and output values for struct objects. } \examples{ diff --git a/man/cash-struct_class-method.Rd b/man/cash-struct_class-method.Rd index 7d61a5c..51e2b72 100644 --- a/man/cash-struct_class-method.Rd +++ b/man/cash-struct_class-method.Rd @@ -15,7 +15,7 @@ Parameter/output value } \description{ -Dollar syntax can be used to as a shortcut for getting/setting input parameter +Dollar syntax can be used to as a shortcut for getting/setting input parameter and output values for struct objects. } \examples{ diff --git a/man/chart_names.Rd b/man/chart_names.Rd index 852f903..dd5eedf 100644 --- a/man/chart_names.Rd +++ b/man/chart_names.Rd @@ -12,7 +12,7 @@ chart_names(obj, ret = "char") \arguments{ \item{obj}{An object derived from the struct_class object} -\item{ret}{A string indicating whether a list of objects ('obj') or a list of chart +\item{ret}{A string indicating whether a list of objects ('obj') or a list of chart names ('char') is returned. 'char' is default.} } \value{ @@ -22,14 +22,8 @@ list of chart names, or a list of chart objects Returns a list of valid charts for a struct object } \details{ -The chart_names method searches chart objects that specify the input object -type as an input. +The chart_names method searches for chart objects associated with the unput object. } -\section{Methods (by class)}{ -\itemize{ -\item \code{struct_class}: -}} - \examples{ M = example_model() chart_names(M) # 'example_chart' diff --git a/man/chart_plot.Rd b/man/chart_plot.Rd index 5985a21..206e226 100644 --- a/man/chart_plot.Rd +++ b/man/chart_plot.Rd @@ -23,14 +23,14 @@ a plot object Plots a chart object } \details{ -The optional optional inputs depend on the input object/chart, but might +The optional optional inputs depend on the input object/chart, but might include an additional dataset object or a second model object, for example. } \section{Methods (by class)}{ \itemize{ -\item \code{obj = chart,dobj = ANY}: -}} +\item \code{chart_plot(obj = chart, dobj = ANY)}: +}} \examples{ C = example_chart() chart_plot(C,iris_DatasetExperiment()) diff --git a/man/get_description.Rd b/man/get_description.Rd new file mode 100644 index 0000000..c9db88e --- /dev/null +++ b/man/get_description.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/zzz.R +\name{get_description} +\alias{get_description} +\title{Get struct object help description} +\usage{ +get_description(id) +} +\arguments{ +\item{id}{(character) the name of a struct object to generate documentation for} +} +\value{ +a character string of roxygen formatted documentation for the object +} +\description{ +This +function is to help developers including struct objects in their own R +packages, and isnt intended for general use. +Use with roxygen 2 `@eval` tags this function generates a detailed +description of a struct object generated by extracting names, +descriptions etc from slots in a suitable format. +} +\examples{ +get_description('example_model') + +} diff --git a/man/is_output.Rd b/man/is_output.Rd index 8c30d74..a14d6a5 100644 --- a/man/is_output.Rd +++ b/man/is_output.Rd @@ -20,11 +20,6 @@ TRUE if output name is valid, FALSE if not \description{ Verify that the name of a output is valid for an object } -\section{Methods (by class)}{ -\itemize{ -\item \code{struct_class}: -}} - \examples{ M = example_model() is_output(M,'result_1') # TRUE diff --git a/man/is_param.Rd b/man/is_param.Rd index baba22c..9d531ad 100644 --- a/man/is_param.Rd +++ b/man/is_param.Rd @@ -20,11 +20,6 @@ TRUE if parameter name is valid, FALSE if not \description{ Verify that the input name is a valid input parameter for an object } -\section{Methods (by class)}{ -\itemize{ -\item \code{struct_class}: -}} - \examples{ M = example_model() is_param(M,'value_1') # TRUE diff --git a/man/model.Rd b/man/model.Rd index cf5024e..7c9b116 100644 --- a/man/model.Rd +++ b/man/model.Rd @@ -16,7 +16,9 @@ model( predicted = character(0), seq_in = "data", - seq_fcn = function(x) { return(x) }, + seq_fcn = function(x) { + return(x) + }, ... ) @@ -41,10 +43,10 @@ model( \arguments{ \item{predicted}{The name of an output slot to return when using \code{predicted()} (see details)} -\item{seq_in}{the name of an output slot to connect with the "predicted" output +\item{seq_in}{the name of an output slot to connect with the "predicted" output of another model (see details)} -\item{seq_fcn}{a function to apply to seq_in before inputting into the next model. +\item{seq_fcn}{a function to apply to seq_in before inputting into the next model. Typically used to extract a single column, or convert from factor to char etc.} \item{...}{named slots and their values.} @@ -66,9 +68,9 @@ dataset dataset object with the reverse model applied the predicted output, as specified by predicted_name -the id of the input parameter to be replaced by the \code{predicted} -output of the previous model in a model sequence. Reserved keyword 'data' -means that the input data used by \code{model_train}, \code{model_apply} etc is used. +the id of the input parameter to be replaced by the \code{predicted} +output of the previous model in a model sequence. Reserved keyword 'data' +means that the input data used by \code{model_train}, \code{model_apply} etc is used. \code{seq_in = 'data'} is the default setting. the modified model object @@ -93,11 +95,11 @@ into the next model in a sequence as the data for that model. \section{\code{seq_in} slot}{ -In a sequence of models (see model_seq) the "predicted" slot is connected to the +In a sequence of models (see model_seq) the "predicted" slot is connected to the DatasetExperiment input of the next model. \code{seq_in} can be used to control flow and connect the "predicted" output to the input parameter of the next model. -Default is the keyword 'data', and can otherwise be replaced by any input slot -from the model. The slot \code{seq_fcn} can be used to apply a transformation to +Default is the keyword 'data', and can otherwise be replaced by any input slot +from the model. The slot \code{seq_fcn} can be used to apply a transformation to the output before it is used as an input. This allows you to e.g. convert between types, extract a single column from a data.frame etc. } diff --git a/man/model_apply.Rd b/man/model_apply.Rd index 9ac3087..74c4e7a 100644 --- a/man/model_apply.Rd +++ b/man/model_apply.Rd @@ -4,12 +4,14 @@ \alias{model_apply} \title{Apply a model} \usage{ -model_apply(M, D) +model_apply(M, D, ...) } \arguments{ \item{M}{a `method` object} \item{D}{another object used by the first} + +\item{...}{other optional inputs} } \value{ Returns a modified method object diff --git a/man/model_reverse.Rd b/man/model_reverse.Rd index f195c1b..5c7a9d1 100644 --- a/man/model_reverse.Rd +++ b/man/model_reverse.Rd @@ -4,12 +4,14 @@ \alias{model_reverse} \title{Reverse preprocessing} \usage{ -model_reverse(M, D) +model_reverse(M, D, ...) } \arguments{ \item{M}{a model object} \item{D}{a dataset object} + +\item{...}{other optional inputs} } \value{ Returns a modified dataset object diff --git a/man/new_struct.Rd b/man/new_struct.Rd index 2bd9771..a0be209 100644 --- a/man/new_struct.Rd +++ b/man/new_struct.Rd @@ -15,10 +15,10 @@ new_struct(class, ...) An object derived from struct_class } \description{ -This function creates a newly allocated object from the class identified by -the first argument. It works almost identically to \code{new} but is specific -to objects from the \pkg{struct} package and ensures that \code{entity} slots have -their values assigned correctly. This function is usually called by class +This function creates a newly allocated object from the class identified by +the first argument. It works almost identically to \code{new} but is specific +to objects from the \pkg{struct} package and ensures that \code{entity} slots have +their values assigned correctly. This function is usually called by class constructors and not used directly. } \examples{ diff --git a/man/ontology.Rd b/man/ontology.Rd index dffccee..8131981 100644 --- a/man/ontology.Rd +++ b/man/ontology.Rd @@ -35,7 +35,7 @@ ontology_list(terms = list()) \arguments{ \item{obj}{a struct object} -\item{cache}{a named list of ontology_terms for offline use. Terms from the cache are search +\item{cache}{a named list of ontology_terms for offline use. Terms from the cache are search based on the name of the list items matching the ontology id. If cache=NULL then the OLS API is used to lookup terms.} \item{id}{(character) The ontology term id e.g. 'STATO:0000555'} diff --git a/man/output_ids.Rd b/man/output_ids.Rd index e02088a..d134d16 100644 --- a/man/output_ids.Rd +++ b/man/output_ids.Rd @@ -18,11 +18,6 @@ list of output ids \description{ return a list of valid output ids for an object } -\section{Methods (by class)}{ -\itemize{ -\item \code{struct_class}: -}} - \examples{ M = example_model() output_ids(M) diff --git a/man/output_list.Rd b/man/output_list.Rd index d761c85..1131923 100644 --- a/man/output_list.Rd +++ b/man/output_list.Rd @@ -28,13 +28,6 @@ struct object \description{ get/set a named list of outputs and their current value for an object } -\section{Methods (by class)}{ -\itemize{ -\item \code{struct_class}: - -\item \code{obj = struct_class,value = list}: -}} - \examples{ M = example_model() L = output_list(M) diff --git a/man/output_name.Rd b/man/output_name.Rd index f7d9168..8cddd97 100644 --- a/man/output_name.Rd +++ b/man/output_name.Rd @@ -20,11 +20,6 @@ name of output \description{ return a the name for a output, if available } -\section{Methods (by class)}{ -\itemize{ -\item \code{obj = struct_class,name = character}: -}} - \examples{ M = example_model() output_name(M,'result_1') diff --git a/man/output_obj.Rd b/man/output_obj.Rd index 44caa4e..e11b6eb 100644 --- a/man/output_obj.Rd +++ b/man/output_obj.Rd @@ -33,13 +33,6 @@ the modified object \description{ Gets or sets the object of an output e.g. to an entity() object. } -\section{Methods (by class)}{ -\itemize{ -\item \code{obj = struct_class,name = character}: - -\item \code{obj = struct_class,name = character}: -}} - \examples{ # get the output as an object M = example_model() diff --git a/man/output_value.Rd b/man/output_value.Rd index 0394e80..c170e2c 100644 --- a/man/output_value.Rd +++ b/man/output_value.Rd @@ -30,13 +30,6 @@ struct object \description{ get/set the values for an output_ } -\section{Methods (by class)}{ -\itemize{ -\item \code{obj = struct_class,name = character}: - -\item \code{obj = struct_class,name = character}: -}} - \examples{ M = example_model() output_value(M,'result_1') diff --git a/man/param_ids.Rd b/man/param_ids.Rd index 0b84833..58317c9 100644 --- a/man/param_ids.Rd +++ b/man/param_ids.Rd @@ -18,11 +18,6 @@ list of parameter ids \description{ return a list of valid parameter ids for an object } -\section{Methods (by class)}{ -\itemize{ -\item \code{struct_class}: -}} - \examples{ M = example_model() param_ids(M) diff --git a/man/param_list.Rd b/man/param_list.Rd index 6597734..8b03198 100644 --- a/man/param_list.Rd +++ b/man/param_list.Rd @@ -26,13 +26,6 @@ A named list of parameters names and corresponding values \description{ get/set a named list of parameters and thier current value for an object } -\section{Methods (by class)}{ -\itemize{ -\item \code{struct_class}: - -\item \code{obj = struct_class,value = list}: -}} - \examples{ M = example_model() L = param_list(M) diff --git a/man/param_name.Rd b/man/param_name.Rd index 2e9c669..4fd1e87 100644 --- a/man/param_name.Rd +++ b/man/param_name.Rd @@ -20,11 +20,6 @@ name of parameter \description{ Returns the name for a parameter, if available } -\section{Methods (by class)}{ -\itemize{ -\item \code{obj = struct_class,name = character}: -}} - \examples{ M = example_model() param_name(M,'value_1') diff --git a/man/param_value.Rd b/man/param_value.Rd index 66fc97f..07a74ed 100644 --- a/man/param_value.Rd +++ b/man/param_value.Rd @@ -28,13 +28,6 @@ Value of parameter \description{ get/set the values for a parameter. } -\section{Methods (by class)}{ -\itemize{ -\item \code{obj = struct_class,name = character}: - -\item \code{obj = struct_class,name = character}: -}} - \examples{ M = example_model() param_value(M,'value_1') diff --git a/man/predict.Rd b/man/predict.Rd index 7e2cfe5..8cc41bc 100644 --- a/man/predict.Rd +++ b/man/predict.Rd @@ -4,12 +4,14 @@ \alias{model_predict} \title{Model prediction} \usage{ -model_predict(M, D) +model_predict(M, D, ...) } \arguments{ \item{M}{a model object} \item{D}{a dataset object} + +\item{...}{other optional inputs} } \value{ Returns a modified model object diff --git a/man/seq_in.Rd b/man/seq_in.Rd index 70e23ec..effa2a5 100644 --- a/man/seq_in.Rd +++ b/man/seq_in.Rd @@ -16,14 +16,14 @@ seq_in(M) <- value } \value{ \describe{ -\item{\code{seq_in}}{returns the name of the input parameter replaced +\item{\code{seq_in}}{returns the name of the input parameter replaced when used in a model sequence} -\item{\code{seq_in<-}}{sets the name of the input parameter replaced +\item{\code{seq_in<-}}{sets the name of the input parameter replaced when used in a model sequence} } } \description{ -get/set the input parameter replaced by the output of the previous model in +get/set the input parameter replaced by the output of the previous model in a model sequence. Default is "data" which passes the output as the data input for methods such as \code{model_train} and \code{model_apply}. } diff --git a/man/struct_class-class.Rd b/man/struct_class-class.Rd index 0e566d7..bd05f00 100644 --- a/man/struct_class-class.Rd +++ b/man/struct_class-class.Rd @@ -15,9 +15,9 @@ and not intended for direct use. It defines slots and methods common to all } \section{Public slots}{ -Public slots can be accessed using shorthand $ notation and are intended for +Public slots can be accessed using shorthand $ notation and are intended for users building workflows. - + \describe{ \item{\code{name}}{\code{character()} A short descriptive name of the struct object} \item{\code{description}}{\code{character()} A longer description of the struct object and what it does} @@ -31,7 +31,7 @@ users building workflows. \section{Private slots}{ Private slots are not readily accessible to users and are intended for developers -creating their own struct objects. Any slot not listed within `.params` or +creating their own struct objects. Any slot not listed within `.params` or `.outputs` is considered a private slot. \describe{ diff --git a/man/train.Rd b/man/train.Rd index e3e085e..8faa5fe 100644 --- a/man/train.Rd +++ b/man/train.Rd @@ -4,12 +4,14 @@ \alias{model_train} \title{Train a model} \usage{ -model_train(M, D) +model_train(M, D, ...) } \arguments{ \item{M}{a model object} \item{D}{a dataset object} + +\item{...}{other optional inputs} } \value{ Returns a modified model object