• Stars
    star
    291
  • Rank 142,563 (Top 3 %)
  • Language
    R
  • License
    Other
  • Created almost 8 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Create fake data in R

charlatan

Project Status: Active – The project has reached a stable, usable state and is being actively developed. R-check cran checks cran version rstudio mirror downloads

charlatan makes fake data, inspired from and borrowing some code from Python's faker (https://github.com/joke2k/faker)

Make fake data for:

  • person names
  • jobs
  • phone numbers
  • colors: names, hex, rgb
  • credit cards
  • DOIs
  • numbers in range and from distributions
  • gene sequences
  • geographic coordinates
  • emails
  • URIs, URLs, and their parts
  • IP addresses
  • more coming ...

Possible use cases for charlatan:

  • Students in a classroom setting learning any task that needs a dataset.
  • People doing simulations/modeling that need some fake data
  • Generate fake dataset of users for a database before actual users exist
  • Complete missing spots in a dataset
  • Generate fake data to replace sensitive real data with before public release
  • Create a random set of colors for visualization
  • Generate random coordinates for a map
  • Get a set of randomly generated DOIs (Digital Object Identifiers) to assign to fake scholarly artifacts
  • Generate fake taxonomic names for a biological dataset
  • Get a set of fake sequences to use to test code/software that uses sequence data

Reasons to use charlatan:

  • Lite weight, few dependencies
  • Relatively comprehensive types of data, and more being added
  • Comprehensive set of languages supported, more being added
  • Useful R features such as creating entire fake data.frame's

Installation

cran version

install.packages("charlatan")

dev version

remotes::install_github("ropensci/charlatan")
library("charlatan")
set.seed(12345)

high level function

... for all fake data operations

x <- fraudster()
x$job()
#> [1] "Corporate investment banker"
x$name()
#> [1] "Dr. Garey Hamill"
x$color_name()
#> [1] "Ivory"

locale support

Adding more locales through time, e.g.,

Locale support for job data

ch_job(locale = "en_US", n = 3)
#> [1] "Therapeutic radiographer" "Teacher, primary school" 
#> [3] "Lobbyist"
ch_job(locale = "fr_FR", n = 3)
#> [1] "Contrôleur de gestion"    "Bactériologiste"         
#> [3] "Attaché d'administration"
ch_job(locale = "hr_HR", n = 3)
#> [1] "Dokumentarist savjetnik" "Maser – kupeljar"       
#> [3] "Voditelj projekta"
ch_job(locale = "uk_UA", n = 3)
#> [1] "Доцент"              "Дипломат"            "Головний меркшейдер"
ch_job(locale = "zh_TW", n = 3)
#> [1] "牙醫師"           "飛安人員"         "機電技師/工程師"

For colors:

ch_color_name(locale = "en_US", n = 3)
#> [1] "LightSeaGreen" "Brown"         "Aqua"
ch_color_name(locale = "uk_UA", n = 3)
#> [1] "Сиваво-зелений"      "Берлінська лазур"    "Сині яйця малинівки"

More coming soon ...

generate a dataset

ch_generate()
#> # A tibble: 10 × 3
#>    name                    job                              phone_number    
#>    <chr>                   <chr>                            <chr>           
#>  1 King Bartoletti         Trading standards officer        972.438.0296    
#>  2 Dr. Ike Gerhold         Surgeon                          (963)938-1790   
#>  3 Dr. Tatyanna Blanda DVM Estate agent                     856.021.4956x893
#>  4 Antione Grant           Fish farm manager                132.576.3127    
#>  5 Michal Gutmann          Scientist, research (maths)      837.134.4726x743
#>  6 Ross Cartwright PhD     Dealer                           773-448-3969    
#>  7 Michal Balistreri       Phytotherapist                   110-184-6140x699
#>  8 Mabelle Crist           Neurosurgeon                     275-104-0595    
#>  9 Infant Dicki            Armed forces operational officer 766-679-9103x791
#> 10 Karri Heaney            Psychiatric nurse                02278877787
ch_generate('job', 'phone_number', n = 30)
#> # A tibble: 30 × 2
#>    job                                 phone_number      
#>    <chr>                               <chr>             
#>  1 Interior and spatial designer       005-426-5468x0971 
#>  2 Geophysical data processor          459-522-7741      
#>  3 Ophthalmologist                     678.654.1098x445  
#>  4 Engineer, agricultural              373.769.5149      
#>  5 Dealer                              121.204.9799x098  
#>  6 Environmental health practitioner   1-222-568-8486    
#>  7 Surveyor, hydrographic              228.958.1370x0609 
#>  8 Lobbyist                            (976)726-0690x1803
#>  9 Cytogeneticist                      008.111.9486      
#> 10 Designer, blown glass/stained glass 387-870-5348      
#> # … with 20 more rows
#> # ℹ Use `print(n = ...)` to see more rows

person name

ch_name()
#> [1] "Susannah Batz-Mraz"
ch_name(10)
#>  [1] "Deondre Jerde"           "Harriett Goodwin"       
#>  [3] "Kaitlynn Dooley"         "Dr. Alannah Botsford"   
#>  [5] "Koby O'Hara-Goldner"     "Carlene Osinski"        
#>  [7] "Miss Alyson Ankunding"   "Dr. Sommer Schroeder MD"
#>  [9] "Sienna Cummerata"        "Ms. Celena Hermiston"

phone number

ch_phone_number()
#> [1] "872-976-6093x382"
ch_phone_number(10)
#>  [1] "+49(9)6373771353"   "1-055-870-8362x208" "+11(9)5635135534"  
#>  [4] "405.525.0245x20351" "(217)908-6461x9385" "(256)144-8907x242" 
#>  [7] "345-963-8208"       "01949102189"        "368.299.7724x532"  
#> [10] "193-445-5487x40228"

job

ch_job()
#> [1] "Warden/ranger"
ch_job(10)
#>  [1] "Engineer, biomedical"          "Librarian, public"            
#>  [3] "Designer, television/film set" "Orthoptist"                   
#>  [5] "Actuary"                       "Television floor manager"     
#>  [7] "Surgeon"                       "Programmer, applications"     
#>  [9] "Social researcher"             "Engineer, electrical"

credit cards

ch_credit_card_provider()
#> [1] "Voyager"
ch_credit_card_provider(n = 4)
#> [1] "American Express" "Mastercard"       "Voyager"          "VISA 16 digit"
ch_credit_card_number()
#> [1] "4149758795998363"
ch_credit_card_number(n = 10)
#>  [1] "3096280733755669659" "3528862994544207088" "55375315925243502"  
#>  [4] "675963691601916"     "4387854850341820"    "6011460885189949222"
#>  [7] "4755578842679336"    "210015419106563146"  "55222480023215177"  
#> [10] "4247284207922"
ch_credit_card_security_code()
#> [1] "301"
ch_credit_card_security_code(10)
#>  [1] "386" "978" "998" "267" "238" "036" "965" "356" "502" "786"

Usage in the wild

Contributors

similar art

Meta

  • Please report any issues or bugs.
  • License: MIT
  • Get citation information for charlatan in R doing citation(package = 'charlatan')
  • Please note that this package is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

More Repositories

1

drake

An R-focused pipeline toolkit for reproducibility and high-performance computing
R
1,339
star
2

skimr

A frictionless, pipeable approach to dealing with summary statistics
HTML
1,108
star
3

targets

Function-oriented Make-like declarative workflows for R
R
912
star
4

rtweet

🐦 R client for interacting with Twitter's [stream and REST] APIs
R
785
star
5

tabulizer

Bindings for Tabula PDF Table Extractor Library
R
518
star
6

pdftools

Text Extraction, Rendering and Converting of PDF Documents
C++
489
star
7

magick

Magic, madness, heaven, sin
R
440
star
8

visdat

Preliminary Exploratory Visualisation of Data
R
439
star
9

stplanr

Sustainable transport planning with R
R
417
star
10

RSelenium

An R client for Selenium Remote WebDriver
R
332
star
11

rnoaa

R interface to many NOAA data APIs
R
328
star
12

osmdata

R package for downloading OpenStreetMap data
R
315
star
13

software-review

rOpenSci Software Peer Review.
R
279
star
14

iheatmapr

Complex, interactive heatmaps in R
R
259
star
15

taxize

A taxonomic toolbelt for R
R
250
star
16

rrrpkg

Use of an R package to facilitate reproducible research
248
star
17

elastic

R client for the Elasticsearch HTTP API
R
244
star
18

tesseract

Bindings to Tesseract OCR engine for R
R
236
star
19

git2r

R bindings to the libgit2 library
R
216
star
20

qualtRics

Download ⬇️ Qualtrics survey data directly into R!
R
215
star
21

biomartr

Genomic Data Retrieval with R
R
212
star
22

writexl

Portable, light-weight data frame to xlsx exporter for R
C
202
star
23

googleLanguageR

R client for the Google Translation API, Google Cloud Natural Language API and Google Cloud Speech API
HTML
194
star
24

rnaturalearth

An R package to hold and facilitate interaction with natural earth map data 🌍
R
191
star
25

textreuse

Detect text reuse and document similarity
R
188
star
26

piggyback

📦 for using large(r) data files on GitHub
R
182
star
27

tokenizers

Fast, Consistent Tokenization of Natural Language Text
R
179
star
28

rentrez

talk with NCBI entrez using R
R
178
star
29

rcrossref

R client for various CrossRef APIs
R
166
star
30

osmextract

Download and import OpenStreetMap data from Geofabrik and other providers
R
166
star
31

dataspice

🌶️ Create lightweight schema.org descriptions of your datasets
R
159
star
32

rgbif

Interface to the Global Biodiversity Information Facility API
R
155
star
33

tic

Tasks Integrating Continuously: CI-Agnostic Workflow Definitions
R
153
star
34

webchem

Chemical Information from the Web
R
149
star
35

geojsonio

Convert many data formats to & from GeoJSON & TopoJSON
R
148
star
36

tsbox

tsbox: Class-Agnostic Time Series in R
R
148
star
37

MODIStsp

An "R" package for automatic download and preprocessing of MODIS Land Products Time Series
R
147
star
38

ghql

GraphQL R client
R
145
star
39

DataPackageR

An R package to enable reproducible data processing, packaging and sharing.
R
145
star
40

dev_guide

rOpenSci Packages: Development, Maintenance, and Peer Review
R
141
star
41

osfr

R interface to the Open Science Framework (OSF)
R
140
star
42

jqr

R interface to jq
R
139
star
43

tarchetypes

Archetypes for targets and pipelines
R
130
star
44

osmplotr

Data visualisation using OpenStreetMap objects
R
130
star
45

opencv

R bindings for OpenCV
C++
130
star
46

ssh

Native SSH client in R based on libssh
C
126
star
47

RefManageR

R package RefManageR
R
114
star
48

ezknitr

Avoid the typical working directory pain when using 'knitr'
R
112
star
49

spocc

Species occurrence data toolkit for R
R
109
star
50

hunspell

High-Performance Stemmer, Tokenizer, and Spell Checker for R
C++
106
star
51

weathercan

R package for downloading weather data from Environment and Climate Change Canada
R
102
star
52

crul

R6 based http client for R (for developers)
R
102
star
53

UCSCXenaTools

📦 An R package for accessing genomics data from UCSC Xena platform, from cancer multi-omics to single-cell RNA-seq https://cran.r-project.org/web/packages/UCSCXenaTools/
R
102
star
54

gistr

Interact with GitHub gists from R
R
101
star
55

spelling

Tools for Spell Checking in R
R
101
star
56

rfishbase

R interface to the fishbase.org database
R
100
star
57

gutenbergr

Search and download public domain texts from Project Gutenberg
R
99
star
58

git2rdata

An R package for storing and retrieving data.frames in git repositories.
R
99
star
59

openalexR

Getting bibliographic records from OpenAlex
R
98
star
60

bib2df

Parse a BibTeX file to a tibble
R
97
star
61

ckanr

R client for the CKAN API
R
97
star
62

nasapower

API Client for NASA POWER Global Meteorology, Surface Solar Energy and Climatology in R
R
96
star
63

rsvg

SVG renderer for R based on librsvg2
C
95
star
64

EML

Ecological Metadata Language interface for R: synthesis and integration of heterogenous data
R
94
star
65

FedData

Functions to Automate Downloading Geospatial Data Available from Several Federated Data Sources
R
94
star
66

cyphr

:shipit: Humane encryption
R
93
star
67

GSODR

API Client for Global Surface Summary of the Day (GSOD) Weather Data Client in R
R
90
star
68

mapscanner

R package to print maps, draw on them, and scan them back in
R
88
star
69

av

Working with Video in R
C
88
star
70

opencage

🌐 R package for the OpenCage API -- both forward and reverse geocoding 🌐
R
87
star
71

gittargets

Data version control for reproducible analysis pipelines in R with {targets}.
R
85
star
72

tidync

NetCDF exploration and data extraction
R
85
star
73

historydata

Datasets for Historians
R
83
star
74

rzmq

R package for ZMQ
C++
82
star
75

CoordinateCleaner

Automated flagging of common spatial and temporal errors in biological and palaeontological collection data, for the use in conservation, ecology and palaeontology.
HTML
79
star
76

rebird

Wrapper to the eBird API
R
79
star
77

smapr

An R package for acquisition and processing of NASA SMAP data
R
79
star
78

bikedata

🚲 Extract data from public hire bicycle systems
R
79
star
79

dittodb

dittodb: A Test Environment for DB Queries in R
R
78
star
80

arkdb

Archive and unarchive databases as flat text files
R
78
star
81

fingertipsR

R package to interact with Public Health England’s Fingertips data tool
R
78
star
82

vcr

Record HTTP calls and replay them
R
77
star
83

nodbi

Document DBI connector for R
R
76
star
84

opentripplanner

An R package to set up and use OpenTripPlanner (OTP) as a local or remote multimodal trip planner.
R
73
star
85

nlrx

nlrx NetLogo R
R
71
star
86

slopes

Package to calculate slopes of roads, rivers and trajectories
R
70
star
87

tidyhydat

An R package to import Water Survey of Canada hydrometric data and make it tidy
R
70
star
88

rb3

A bunch of downloaders and parsers for data delivered from B3
R
69
star
89

robotstxt

robots.txt file parsing and checking for R
R
68
star
90

codemetar

an R package for generating and working with codemeta
R
66
star
91

tradestatistics

R package to access Open Trade Statistics API
R
65
star
92

unconf17

Website for 2017 rOpenSci Unconf
JavaScript
64
star
93

roadoi

Use Unpaywall with R
R
64
star
94

terrainr

Get DEMs and orthoimagery from the USGS National Map, georeference your images and merge rasters, and visualize with Unity 3D
R
64
star
95

tiler

Generate geographic and non-geographic map tiles from R
R
64
star
96

comtradr

Functions for Interacting with the UN Comtrade API
R
64
star
97

NLMR

📦 R package to simulate neutral landscape models 🏔
R
63
star
98

parzer

Parse geographic coordinates
R
63
star
99

rWBclimate

R interface for the World Bank climate data
R
62
star
100

stats19

R package for working with open road traffic casualty data from Great Britain
R
61
star