dpsl: Dput Select.list Shortcut

Description Usage Arguments Details Author(s) See Also Examples

View source: R/dpsl.R

Description

This function is a shortcut to use dput select.list for variable names from a data frame.

Usage

1
dpsl(df, ind = "col", multiple = TRUE, graphics = TRUE, quotes = TRUE, ...)

Arguments

df

The data frame that the list should come from

ind

The index of names that should be used: 1/'row" for rownames, 2/'col' for column names

multiple

Passed to select.list: should multiple entries be used? Defaults to TRUE.

graphics

Passed to select.list: should graphics be used? Defaults to TRUE.

quotes

Do you want quotes around each element? Defaults to TRUE.

...

Passed to select.list

Details

The function simply rewrites some defaults for select.list and wraps it in a dput. It has an option to select columns or rows, simply by changing the input from "columnames" to "rownames" via an if statement. Nothing fancy, but certainly much shorter than what I normally use.

Author(s)

Michael Floren

See Also

dput, select.list

Examples

1
2
3
4
5
6
7
8
#to list selected column names from iris (control click to select multiple)
dpsl(iris)

#to list selected rows, use ind="row"
dpsl(iris, ind="row") #could also use dpsl(iris, ind=1

#to select columns from iris
iris[,dpsl(iris)]

flor3652/myStuff documentation built on Sept. 14, 2020, 1:16 a.m.