These functions are used during the execution of a program. Rather they produce snippets that can be pasted into code, and help the developer avoid some typing.

column_rename_headstart( d, try_snake_case=TRUE, use_nse=TRUE )
column_class_headstart( d )
column_value_headstart( x )

Arguments

d

A data.frame to describe.

try_snake_case

If TRUE column names are attempted to be converted to snake_case.

use_nse

Specify columns with NSE (non-standard evaluation; a.k.a., without quotes).

x

A vector to describe.

Value

Prints formatted code to the console.

Author

Will Beasley

Examples

column_rename_headstart(datasets::OrchardSprays)
#> dplyr::select(    # `dplyr::select()` drops columns not included.
#>   decrease                 = `decrease`,
#>   rowpos                   = `rowpos`,
#>   colpos                   = `colpos`,
#>   treatment                = `treatment`,
#> )
column_rename_headstart(datasets::iris)
#> dplyr::select(    # `dplyr::select()` drops columns not included.
#>   sepal_length                = `Sepal.Length`,
#>   sepal_width                 = `Sepal.Width`,
#>   petal_length                = `Petal.Length`,
#>   petal_width                 = `Petal.Width`,
#>   species                     = `Species`,
#> )
column_class_headstart(datasets::OrchardSprays)
#> , "decrease"   = "numeric"
#> , "rowpos"     = "numeric"
#> , "colpos"     = "numeric"
#> , "treatment"  = "factor"
column_value_headstart(datasets::OrchardSprays$treatment)
#> , "A"  = "A"
#> , "B"  = "B"
#> , "C"  = "C"
#> , "D"  = "D"
#> , "E"  = "E"
#> , "F"  = "F"
#> , "G"  = "G"
#> , "H"  = "H"