attach.env: Attach Variables to a Function

Description Usage Arguments Value Note Author(s)

Description

Returns a function, specified by the user, with the variables of a specified environment attached. This, in essence, allows programmers to write functions that have forms of private memory. This makes the function behave similarly to an object.

Usage

1
  attach.env(f, env = NULL, ...)

Arguments

f

a function which will be modified

env

an environment variable which will be attached to the function being returned

...

arbitrary key-value paired parameters which will be assigned to the environment of the function being returned

Value

the original function “f” with a different environment attached to it.

Note

This function is used by Zelig to ensure that particular method calls - param, qi, bootstap - will contain the private variables: “.fitted”, “.model”, “.call” and “.env” which respectively contain the fitted model object, the name of the zelig model being invoked, the original call to the model-fitting function and the environment in which to call the function call.

Author(s)

Matt Owen mowen@iq.harvard.edu


IQSS/Zelig4 documentation built on May 9, 2019, 9:13 a.m.