Make fake data, supporting addresses, person names, dates, times, colors, coordinates, currencies, digital object identifiers (DOIs), jobs, phone numbers, DNA sequences, doubles and integers from distributions and within a range.

Package API

  • ch_generate(): generate a data.frame with fake data

  • fraudster(): single interface to all fake data methods

  • High level interfaces: There are high level functions prefixed with ch_ that wrap low level interfaces, and are meant to be easier to use and provide easy way to make many instances of a thing.

  • Low level interfaces: All of these are R6 objects that a user can initialize and then call methods on the them.

Author

Scott Chamberlain [email protected]

Kyle Voytovich

Martin Pedersen

Examples

# generate individual types of data
ch_name()
#> [1] "Tegan Steuber"
ch_phone_number()
#> [1] "962.123.0856"
ch_job()
#> [1] "Scientist, physiological"

# generate a data.frame
ch_generate()
#> # A tibble: 10 × 3
#>    name                         job                           phone_number      
#>    <chr>                        <chr>                         <chr>             
#>  1 Willaim Waters-Schultz       Psychiatrist                  922-152-7914x328  
#>  2 Dr. Eller Dickens            Counselling psychologist      +86(8)4300029511  
#>  3 Lia Rath MD                  Farm manager                  094.302.9941x19315
#>  4 Norene Oberbrunner-Wilderman Land                          1-127-773-2842x03…
#>  5 Gearldine Gutkowski-Klein    Accountant, chartered public… 164-621-4266x576  
#>  6 Clovis Kris                  Chartered accountant          599-818-6003x879  
#>  7 Mr. Hezekiah Price           Pensions consultant           921.871.5726x393  
#>  8 Josue Schaden                Farm manager                  794.301.1242      
#>  9 Justina Mayer                Music therapist               08427989817       
#> 10 Annabell Kling               Biochemist, clinical          1-602-248-4601    

# one interface to all data types - generate the class first
#  reports the locale to be used, can change optionally
(x <- fraudster())
#> <fraudster>
#>   locale: en_US
x$job()
#> [1] "Data scientist"
x$name()
#> [1] "Thurlow Grady"
x$color_name()
#> [1] "MediumAquaMarine"
x$hex_color()
#> [1] "#B69E2C"

# low level interfaces to "data providers"
# these are exported by hidden from package man page
# as most users will likely not interact with these
x <- ColorProvider$new()
x$color_name()
#> [1] "FloralWhite"
x$hex_color()
#> [1] "#644097"