-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
96 lines (66 loc) · 2.39 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
---
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%"
)
```
# facetsr
<!-- badges: start -->
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
<!-- badges: end -->
The goal of facetsr is to create an R wrapper for facets.
I watched the presentation from RStudio 2020 Conf on [Data, visualization, and designing AI - Fernanda Viegas & Martin Wattenberg](https://resources.rstudio.com/rstudio-conf-2020/data-visualization-and-designing-ai-fernanda-viegas-and-martin-wattenberg). Facets library discussed there were quite inspiring but I couldn’t find an R wrapper for that so I have created my own. I believe it can be used for more than just AI data. You can take a look but, please, note the package is just a proof of concept.
If you find it useful, I’d appreciate your feedback.
## Facets information
- [Facetes homepage](https://pair-code.github.io/facets/)
- [RStudio 2020 Conf Keynote Presentation](https://resources.rstudio.com/rstudio-conf-2020/data-visualization-and-designing-ai-fernanda-viegas-and-martin-wattenberg)
## Installation
You can install the released version of facetsr from [github](https://github.com/openpharma/facetsr) with:
``` r
remotes::install_github("openpharma/facetsr")
```
## Example
This is a basic example which shows how to start using facets.
![](man/figures/factes.gif)
```R
library(facetsr)
# facets dive
facets_dive(iris)
# facets overview
facets_overview(iris)
facets_overview(list(list(data = iris, name = "iris"), list(data = cars, name = "cars")))
```
## Shiny
You can use facetsr in shiny apps.
Example:
```R
# app.R
library(shiny)
library(facetsr)
server <- function(input, output, session) {
output$facets<- render_facets({
facets(iris)
})
}
ui <- fluidPage(
facets_output("facets")
)
shinyApp(ui = ui, server = server)
```
## Rmarkdown
**Note: For Rmarkdown only facets_div is working.**
Use standard R chunks to load librarry
```{r comment = "", echo = FALSE}
"{r facets_dive}
facets_dive(datasets::airquality)
" -> my_code_string
cat("```", my_code_string, "```", sep = "")
```
## Feedback and contribution
Just don’t hesitate of contact me or opening pull request.