The append_to_list() function appends an object to the specified list in Global Environment (default). This function is pipe-optimised, and allows the option of specifying a name for the new object in the list.

append_to_list(x, list_x, name = "", enviro = .GlobalEnv)

Arguments

x

An object to append to list, e.g. vector, data frame.

list_x

Target list to append object to.

name

Specify a character string for the name of the list. Defaults to blank

enviro

Specifies the environment

Examples

a_list <- list(NULL)
append_to_list(iris,a_list,"iris")