Skip to contents

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

Roel M. Hogervorst hogervorst.rm@gmail.com

Scott Chamberlain

Kyle Voytovich

Martin Pedersen

Examples

# generate individual types of data
ch_name()
#> [1] "Lim Kulas"
ch_phone_number()
#> [1] "02171860091"
ch_job()
#> [1] "Designer, industrial/product"

# generate a data.frame
ch_generate()
#> # A tibble: 10 × 3
#>    name                    job                                  phone_number    
#>    <chr>                   <chr>                                <chr>           
#>  1 Agustin Kozey           IT sales professional                817.771.5781x049
#>  2 Lovett Collier I        Marine scientist                     1-783-405-5040  
#>  3 Infant McCullough II    Investment banker, corporate         1-160-985-5013  
#>  4 Jasmyne O'Conner        Accountant, chartered certified      223-529-3953    
#>  5 Cortney Eichmann        Community pharmacist                 965-490-8010    
#>  6 Hasan Kemmer            Adult nurse                          (485)974-6654x4…
#>  7 Mr. Tavian Koch III     International aid/development worker 933.711.9707    
#>  8 Anderson Mann-Lueilwitz Press sub                            (267)403-9146x3…
#>  9 Clemie Quigley DVM      Engineer, building services          (121)273-5106   
#> 10 Ebony Marks             Psychologist, forensic               (851)018-2824   

# 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] "Civil engineer, consulting"
x$name()
#> [1] "Sidney Waelchi"
x$color_name()
#> [1] "Magenta"
x$hex_color()
#> [1] "#01447E"

# 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_en_US$new()
x$color_name()
#> [1] "Red"
x$hex_color()
#> [1] "#C6354A"