-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.Rmd
96 lines (77 loc) · 2.17 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Random names
[![Travis-CI Build Status](https://travis-ci.org/karthik/randNames.png?branch=master)](https://travis-ci.org/karthik/randNames) [![Coverage Status](https://coveralls.io/repos/karthik/randNames/badge.svg)](https://coveralls.io/r/karthik/randNames) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/randNames)](https://cran.r-project.org/package=randNames) [![](http://cranlogs.r-pkg.org/badges/randNames)](http://cran.rstudio.com/web/packages/randNames/index.html)
The package provides a programmatic interface to the Random Names API and returns 'sample' user data including fake first/last names, emails, SSNs, addresses, avatars and more. Search queries can be further filtered by gender and nationality.
```{r, echo = FALSE, message = FALSE}
knitr::opts_chunk$set(
comment = "#>",
cache = FALSE,
error = FALSE,
message = FALSE,
tidy = FALSE
)
```
**Installation**
```{r, eval = FALSE}
install.packages("randNames")
````
or for the development version
```{r, eval = FALSE}
devtools::install_github("karthik/randNames")
```
It queries a random name API and returns a whole bunch of useful fields.
```{r, names, cache = TRUE}
library(dplyr)
library(randNames)
20 %>%
rand_names %>%
select(first = name.first, last = name.last)
```
__Filter by nationality__
```{r, nationality, cache = TRUE}
15 %>%
# Available nationalities: AU, BR, CA, CH, DE, DK, ES, FI, FR, GB, IE, IR, NL, NZ, TR, US
# You can specify multiple nationalities. e.g. "gb,us"
rand_names(nationality = "GB") %>%
select(name.first, name.last)
```
__Filter by gender__
```{r, gender}
library(randNames)
15 %>%
rand_names(gender = "female") %>%
select(name.first, name.last)
```
__Set seed__
```{r, seed}
15 %>%
rand_names(seed = 'foobar') %>%
select(name.first, name.last)
```
__Additional fields beyond first and last name__
```
gender
email
registered"
dob
phone
cell
nat
name.title
name.first
name.last
location.street
location.city
location.state
location.postcode
login.username"
login.password
login.salt
login.md5
login.sha1
login.sha256
id.name
id.value
picture.large
picture.medium
picture.thumbnail
```