return_named_list: Collect all local objects and return them as named list.

View source: R/scraping_helpers.R

return_named_listR Documentation

Collect all local objects and return them as named list.

Description

Makes it easier to return a named list from a function.

Usage

return_named_list()

Value

named list of all objects in the function that don't start with a dot.

Examples

# Function that uses return_named_list()
func <- function(a, b) {
  # objects prefixed with a dot get ignored
  .not_include = b
  x = a
  y = NULL
  return_named_list()
}

func(1, 2)

m-g-h/scrapurrr documentation built on Aug. 2, 2022, 9:43 a.m.