-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
75 lines (54 loc) · 1.67 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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# faker
<!-- badges: start -->
[![R-CMD-check](https://github.com/judith-bourque/faker/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/judith-bourque/faker/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
A [Faker API](https://fakerapi.it/en) wrapper package in R.
## Installation
You can install the development version of faker from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("judith-bourque/faker")
```
## Example
This is a basic example which shows you how to get a person using the Faker API:
```{r example}
library(faker)
str(faker_person("male"))
```
This package includes a ggplot2 theme inspired by the Faker API:
```{r echo = FALSE}
library("ggplot2")
library("faker")
mtcars2 <- within(mtcars, {
vs <- factor(vs, labels = c("V-shaped", "Straight"))
am <- factor(am, labels = c("Automatic", "Manual"))
cyl <- factor(cyl)
gear <- factor(gear)
})
p1 <- ggplot(mtcars2) +
geom_point(aes(x = wt, y = mpg, colour = gear)) +
labs(
title = "Fuel economy declines as weight increases",
subtitle = "(1973-74)",
caption = "Data from the 1974 Motor Trend US magazine.",
tag = "Figure 1",
x = "Weight (1000 lbs)",
y = "Fuel economy (mpg)",
colour = "Gears"
)
p1 + theme_custom()
```
## About
`faker` is based on [`httr2`](https://httr2.r-lib.org) and built using the workflow outlined in [R Packages](https://r-pkgs.org).