structure_varlist: creates a formula object from a varlist, mostly for internal...

Description Usage Arguments Value Examples

Description

A varlist in genvar is a space-separated string potentially with wildcard characters, "var1 var2 var3 x*". This function converts a varlist to a formula or to a vector.

Usage

1
structure_varlist(x, type = "formula")

Arguments

x

the varlist to be converted in "var1 var2 var3" format. Can be specified using the globbing characters "*" (match zero or more of any character) or "?" (match any single character) like "var*" or "var?" for "var1 var2 var3" or using regular expressions if regex=TRUE ("var[0-9]+" = "var1 var2 var3").

type

if "formula", return a varlist in formula format; if "vector", return a varlist in character vector format.

Value

a formula object which can be passed to model.frame or a character vector giving the name of each variable

Examples

1
2
3
4
use(cars, clear=TRUE)
structure_varlist("speed dist", type="formula")
structure_varlist("speed dist", type="vector")
structure_varlist("*", type="vector")

genvar documentation built on Jan. 21, 2020, 9:07 a.m.