Hadoop Online Training by Edureka

generate_quantity: Add new quantity to shinystan object

Description Usage Arguments Value See Also Examples

Description

Add to shinystan object a new parameter as a function of one or two existing parameters.

Usage

1
generate_quantity(sso, param1, param2, fun, new_name)

Arguments

sso

A shinystan object.

param1

Name of first parameter as character string.

param2

Optional. Name of second paramter as character string.

fun

Function to call, i.e. function(param1) or function(param1,param2). See Examples, below.

new_name

Name for the new parameter as character string.

Value

sso, updated. See Examples.

See Also

drop_parameters to remove parameters from a shinystan object.

Examples

1
2
3
4
5
6
7
8
# Using example shinystan object 'eight_schools'
sso <- eight_schools
sso <- generate_quantity(sso, fun = function(x) x^2, 
                         param1 = "tau", new_name = "tau_sq")
sso <- generate_quantity(sso, fun = "-", 
                         param1 = "theta[1]", param2 = "theta[2]", 
                         new_name = "theta1minus2")
                         


Search within the shinystan package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.