variables: Available Variable Functions

Description Usage Arguments Value Examples

View source: R/variables.R

Description

See a listing of all available variable functions for use in r_data_frame or r_list.

Usage

1
variables(type = NULL, ncols = 5, ...)

Arguments

type

The output type. Must be either NULL (returns a character vector), "matrix", or "list"; or the user may extract a specific type from a list using: "character", "date", "factor", "integer", "logical", "numeric", "ordered factor". Setting type = TRUE will also return a list. The list version breaks the variable functions into classes. Specifying a specific class (e.g., type = "numeric" will list only variable functions that yield a numeric output.

ncols

The number of columns to use if type = "matrix".

...

Other arguments passed to matrix.

Value

Returns a character vector, matrix of all variable functions, or a list of variable functions by type.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
variables()

variables("list")
variables(TRUE)
names(variables("list"))
variables("ordered factor")
variables("numeric")

variables("matrix")
variables("matrix", ncols=3)
variables("matrix", 1)
variables("matrix", byrow = TRUE)

Example output

 [1] "age"              "animal"           "answer"           "area"            
 [5] "car"              "children"         "coin"             "color"           
 [9] "date_stamp"       "death"            "dice"             "dna"             
[13] "dob"              "dummy"            "education"        "employment"      
[17] "eye"              "grade"            "grade_level"      "group"           
[21] "hair"             "height"           "income"           "internet_browser"
[25] "iq"               "language"         "level"            "likert"          
[29] "lorem_ipsum"      "marital"          "military"         "month"           
[33] "name"             "normal"           "political"        "race"            
[37] "religion"         "sat"              "sentence"         "sex"             
[41] "sex_inclusive"    "smokes"           "speed"            "state"           
[45] "string"           "upper"            "valid"            "year"            
[49] "zip_code"        
$character
[1] "lorem_ipsum" "name"        "sentence"    "string"      "upper"      
[6] "zip_code"   

$date
[1] "date_stamp" "dob"       

$factor
 [1] "animal"           "answer"           "area"             "car"             
 [5] "coin"             "color"            "dna"              "education"       
 [9] "employment"       "eye"              "grade_level"      "group"           
[13] "hair"             "internet_browser" "language"         "marital"         
[17] "military"         "month"            "political"        "race"            
[21] "religion"         "sex"              "sex_inclusive"    "state"           

$integer
[1] "age"      "children" "dice"     "level"    "year"    

$logical
[1] "death"  "smokes" "valid" 

$numeric
[1] "dummy"  "grade"  "height" "income" "iq"     "normal" "sat"    "speed" 

$`ordered factor`
[1] "likert"

$character
[1] "lorem_ipsum" "name"        "sentence"    "string"      "upper"      
[6] "zip_code"   

$date
[1] "date_stamp" "dob"       

$factor
 [1] "animal"           "answer"           "area"             "car"             
 [5] "coin"             "color"            "dna"              "education"       
 [9] "employment"       "eye"              "grade_level"      "group"           
[13] "hair"             "internet_browser" "language"         "marital"         
[17] "military"         "month"            "political"        "race"            
[21] "religion"         "sex"              "sex_inclusive"    "state"           

$integer
[1] "age"      "children" "dice"     "level"    "year"    

$logical
[1] "death"  "smokes" "valid" 

$numeric
[1] "dummy"  "grade"  "height" "income" "iq"     "normal" "sat"    "speed" 

$`ordered factor`
[1] "likert"

[1] "character"      "date"           "factor"         "integer"       
[5] "logical"        "numeric"        "ordered factor"
$`ordered factor`
[1] "likert"

$numeric
[1] "dummy"  "grade"  "height" "income" "iq"     "normal" "sat"    "speed" 

      [,1]         [,2]          [,3]               [,4]        [,5]           
 [1,] "age"        "dice"        "hair"             "military"  "sex_inclusive"
 [2,] "animal"     "dna"         "height"           "month"     "smokes"       
 [3,] "answer"     "dob"         "income"           "name"      "speed"        
 [4,] "area"       "dummy"       "internet_browser" "normal"    "state"        
 [5,] "car"        "education"   "iq"               "political" "string"       
 [6,] "children"   "employment"  "language"         "race"      "upper"        
 [7,] "coin"       "eye"         "level"            "religion"  "valid"        
 [8,] "color"      "grade"       "likert"           "sat"       "year"         
 [9,] "date_stamp" "grade_level" "lorem_ipsum"      "sentence"  "zip_code"     
[10,] "death"      "group"       "marital"          "sex"                      
      [,1]         [,2]               [,3]           
 [1,] "age"        "grade"            "political"    
 [2,] "animal"     "grade_level"      "race"         
 [3,] "answer"     "group"            "religion"     
 [4,] "area"       "hair"             "sat"          
 [5,] "car"        "height"           "sentence"     
 [6,] "children"   "income"           "sex"          
 [7,] "coin"       "internet_browser" "sex_inclusive"
 [8,] "color"      "iq"               "smokes"       
 [9,] "date_stamp" "language"         "speed"        
[10,] "death"      "level"            "state"        
[11,] "dice"       "likert"           "string"       
[12,] "dna"        "lorem_ipsum"      "upper"        
[13,] "dob"        "marital"          "valid"        
[14,] "dummy"      "military"         "year"         
[15,] "education"  "month"            "zip_code"     
[16,] "employment" "name"                            
[17,] "eye"        "normal"                          
      [,1]              
 [1,] "age"             
 [2,] "animal"          
 [3,] "answer"          
 [4,] "area"            
 [5,] "car"             
 [6,] "children"        
 [7,] "coin"            
 [8,] "color"           
 [9,] "date_stamp"      
[10,] "death"           
[11,] "dice"            
[12,] "dna"             
[13,] "dob"             
[14,] "dummy"           
[15,] "education"       
[16,] "employment"      
[17,] "eye"             
[18,] "grade"           
[19,] "grade_level"     
[20,] "group"           
[21,] "hair"            
[22,] "height"          
[23,] "income"          
[24,] "internet_browser"
[25,] "iq"              
[26,] "language"        
[27,] "level"           
[28,] "likert"          
[29,] "lorem_ipsum"     
[30,] "marital"         
[31,] "military"        
[32,] "month"           
[33,] "name"            
[34,] "normal"          
[35,] "political"       
[36,] "race"            
[37,] "religion"        
[38,] "sat"             
[39,] "sentence"        
[40,] "sex"             
[41,] "sex_inclusive"   
[42,] "smokes"          
[43,] "speed"           
[44,] "state"           
[45,] "string"          
[46,] "upper"           
[47,] "valid"           
[48,] "year"            
[49,] "zip_code"        
      [,1]            [,2]       [,3]     [,4]               [,5]       
 [1,] "age"           "animal"   "answer" "area"             "car"      
 [2,] "children"      "coin"     "color"  "date_stamp"       "death"    
 [3,] "dice"          "dna"      "dob"    "dummy"            "education"
 [4,] "employment"    "eye"      "grade"  "grade_level"      "group"    
 [5,] "hair"          "height"   "income" "internet_browser" "iq"       
 [6,] "language"      "level"    "likert" "lorem_ipsum"      "marital"  
 [7,] "military"      "month"    "name"   "normal"           "political"
 [8,] "race"          "religion" "sat"    "sentence"         "sex"      
 [9,] "sex_inclusive" "smokes"   "speed"  "state"            "string"   
[10,] "upper"         "valid"    "year"   "zip_code"                    

wakefield documentation built on Sept. 14, 2020, 1:07 a.m.