Learn R Programming

latrend (version 1.6.1)

as.list.lcMethod: Extract the method arguments as a list

Description

Extract the method arguments as a list

Usage

# S3 method for lcMethod
as.list(x, ..., args = names(x), eval = TRUE, expand = FALSE, envir = NULL)

Value

A list with the argument calls or evaluated results depending on the value for eval.

Arguments

x

The lcMethod object.

...

Additional arguments.

args

A character vector of argument names to select. Only available arguments are returned. Alternatively, a function or list of functions, whose formal arguments will be selected from the method.

eval

Whether to evaluate the arguments.

expand

Whether to return all method arguments when "..." is present among the requested argument names.

envir

The environment in which to evaluate the arguments. If NULL, the environment associated with the object is used. If not available, the parent.frame() is used.

See Also

Other lcMethod functions: [[,lcMethod-method, as.data.frame.lcMethod(), as.data.frame.lcMethods(), as.lcMethods(), evaluate.lcMethod(), formula.lcMethod(), lcMethod-class, names,lcMethod-method, update.lcMethod()

Examples

Run this code
data(latrendData)
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
as.list(method)

as.list(method, args = c("id", "time"))

if (require("kml")) {
  method <- lcMethodKML("Y", id = "Id", time = "Time")
  as.list(method)

  # select arguments used by kml()
  as.list(method, args = kml::kml)

  # select arguments used by either kml() or parALGO()
  as.list(method, args = c(kml::kml, kml::parALGO))
}

Run the code above in your browser using DataLab