get.fn: grab a function based on its name

Description Usage Arguments Details Value

View source: R/helper_functions.r

Description

helper to grab a fn that is passed in as an argument

Usage

1
get.fn(fn, env = parent.frame())

Arguments

fn

the function to search for

env

the environment to start searching in

Details

this is based on Hadley Wickham's response to an SO post: http://stackoverflow.com/questions/14183766/match-fun-provide-error-with-functions-defined-inside-functions with some minor modifications

Value

fn, if fn is already a function; otherwise, the first function found in env or one of its parents whose name is fn


surveybootstrap documentation built on May 29, 2017, 9:09 a.m.