3
3
4
4
# easyalluvial <a href =' https://erblast.github.io/easyalluvial ' ><img src =' man/figures/logo.png ' align =" right " height =" 139 " /></a >
5
5
6
- [ ![ AppVeyor Build
7
- Status] ( https://ci.appveyor.com/api/projects/status/github/erblast/easyalluvial?branch=master&svg=true )] ( https://ci.appveyor.com/project/erblast/easyalluvial )
8
6
[ ![ R build
9
7
status] ( https://github.com/erblast/easyalluvial/workflows/R-CMD-check/badge.svg )] ( https://github.com/erblast/easyalluvial/actions )
10
8
[ ![ Coverage
@@ -37,17 +35,17 @@ for data exploration.
37
35
38
36
## Features
39
37
40
- - plot alluvial graph with a single line of code of a given dataframe
41
- - support for wide and long data format [ (wiki, wide vs. long/narrow
42
- data)] ( https://en.wikipedia.org/wiki/Wide_and_narrow_data )
43
- - automatically transforms numerical to categorical data
44
- - helper functions for variable selection
45
- - convenient parameters for coloring and ordering
46
- - marginal histograms
47
- - ** model agnostic partial dependence and model response alluvial
48
- plots with 4 dimensions**
49
- - ** [ interactive plots with ` easyalluvial ` and
50
- ` parcats ` ] ( https://erblast.github.io/parcats/articles/parcats.html ) **
38
+ - plot alluvial graph with a single line of code of a given dataframe
39
+ - support for wide and long data format [ (wiki, wide vs. long/narrow
40
+ data)] ( https://en.wikipedia.org/wiki/Wide_and_narrow_data )
41
+ - automatically transforms numerical to categorical data
42
+ - helper functions for variable selection
43
+ - convenient parameters for coloring and ordering
44
+ - marginal histograms
45
+ - ** model agnostic partial dependence and model response alluvial plots
46
+ with 4 dimensions**
47
+ - ** [ interactive plots with ` easyalluvial ` and
48
+ ` parcats ` ] ( https://erblast.github.io/parcats/articles/parcats.html ) **
51
49
52
50
## Installation
53
51
@@ -60,19 +58,20 @@ install.packages('easyalluvial')
60
58
### Development Version
61
59
62
60
``` r
61
+
63
62
# install.packages("devtools")
64
63
devtools :: install_github(" erblast/easyalluvial" )
65
64
```
66
65
67
66
## Documentation
68
67
69
- - [ pkgdown website] ( https://erblast.github.io/easyalluvial/ )
70
- - [ Data Exploration with Alluvial
71
- Plots] ( https://erblast.github.io/easyalluvial/articles/data_exploration.html )
72
- - [ Visualising Model
73
- Response] ( https://erblast.github.io/easyalluvial/articles/model_response.html )
74
- - [ Interactive Plots with
75
- parcats] ( https://erblast.github.io/easyalluvial/articles/parcats.html )
68
+ - [ pkgdown website] ( https://erblast.github.io/easyalluvial/ )
69
+ - [ Data Exploration with Alluvial
70
+ Plots] ( https://erblast.github.io/easyalluvial/articles/data_exploration.html )
71
+ - [ Visualising Model
72
+ Response] ( https://erblast.github.io/easyalluvial/articles/model_response.html )
73
+ - [ Interactive Plots with
74
+ parcats] ( https://erblast.github.io/easyalluvial/articles/parcats.html )
76
75
77
76
## Examples
78
77
@@ -86,6 +85,7 @@ suppressPackageStartupMessages( require(easyalluvial) )
86
85
#### Sample Data
87
86
88
87
``` r
88
+
89
89
knitr :: kable( head(mtcars2 ) )
90
90
```
91
91
@@ -102,13 +102,14 @@ knitr::kable( head(mtcars2) )
102
102
103
103
Continuous Variables will be automatically binned as follows.
104
104
105
- - High, High (HH)
106
- - Medium, High (MH)
107
- - Medium (M)
108
- - Medium, Low (ML)
109
- - Low, Low (LL)
105
+ - High, High (HH)
106
+ - Medium, High (MH)
107
+ - Medium (M)
108
+ - Medium, Low (ML)
109
+ - Low, Low (LL)
110
110
111
111
``` r
112
+
112
113
alluvial_wide( data = mtcars2
113
114
, max_variables = 5
114
115
, fill_by = ' first_variable' )
@@ -124,18 +125,19 @@ alluvial_wide( data = mtcars2
124
125
knitr :: kable( head(quarterly_flights ) )
125
126
```
126
127
127
- | tailnum | carrier | origin | dest | qu | mean \_ arr \_ delay |
128
- | :------------------| :--------| :-------| :-----| :----| :----------------- |
129
- | N0EGMQ LGA BNA MQ | MQ | LGA | BNA | Q1 | on \_ time |
130
- | N0EGMQ LGA BNA MQ | MQ | LGA | BNA | Q2 | on \_ time |
131
- | N0EGMQ LGA BNA MQ | MQ | LGA | BNA | Q3 | on \_ time |
132
- | N0EGMQ LGA BNA MQ | MQ | LGA | BNA | Q4 | on \_ time |
133
- | N11150 EWR MCI EV | EV | EWR | MCI | Q1 | late |
134
- | N11150 EWR MCI EV | EV | EWR | MCI | Q2 | late |
128
+ | tailnum | carrier | origin | dest | qu | mean_arr_delay |
129
+ | :------------------| :--------| :-------| :-----| :----| :---------------|
130
+ | N0EGMQ LGA BNA MQ | MQ | LGA | BNA | Q1 | on_time |
131
+ | N0EGMQ LGA BNA MQ | MQ | LGA | BNA | Q2 | on_time |
132
+ | N0EGMQ LGA BNA MQ | MQ | LGA | BNA | Q3 | on_time |
133
+ | N0EGMQ LGA BNA MQ | MQ | LGA | BNA | Q4 | on_time |
134
+ | N11150 EWR MCI EV | EV | EWR | MCI | Q1 | late |
135
+ | N11150 EWR MCI EV | EV | EWR | MCI | Q2 | late |
135
136
136
137
#### Plot
137
138
138
139
``` r
140
+
139
141
alluvial_long( quarterly_flights
140
142
, key = qu
141
143
, value = mean_arr_delay
@@ -159,17 +161,23 @@ alluvial_wide( data = mtcars2
159
161
### Interactive Graphs
160
162
161
163
``` r
164
+
162
165
suppressPackageStartupMessages( require(parcats ) )
163
166
164
167
p = alluvial_wide(mtcars2 , max_variables = 5 )
165
168
166
169
parcats(p , marginal_histograms = TRUE , data_input = mtcars2 )
167
170
```
168
171
169
- ![ demo] ( https://raw.githubusercontent.com/erblast/parcats/master/man/figures/demo1.gif )
172
+ <figure >
173
+ <img
174
+ src="https://raw.githubusercontent.com/erblast/parcats/master/man/figures/demo1.gif "
175
+ alt="demo" />
176
+ <figcaption aria-hidden =" true " >demo</figcaption >
177
+ </figure >
170
178
171
- - ** [ Live
172
- Widget] ( https://erblast.github.io/parcats/articles/parcats.html ) **
179
+ - ** [ Live
180
+ Widget] ( https://erblast.github.io/parcats/articles/parcats.html ) **
173
181
174
182
### Partial Dependence Alluvial Plots
175
183
@@ -190,14 +198,15 @@ in the end. Each of the possible combinations is plotted as a flow which
190
198
is coloured by the bin corresponding to the average model response
191
199
generated by that particular combination.
192
200
193
- - [ more on partial dependence plots
194
- (ebook)] ( https://christophm.github.io/interpretable-ml-book/ )
195
- - [ Tutorial] ( https://www.datisticsblog.com/2019/04/visualising-model-response-with-easyalluvial/ )
201
+ - [ more on partial dependence plots
202
+ (ebook)] ( https://christophm.github.io/interpretable-ml-book/ )
203
+ - [ Tutorial] ( https://www.datisticsblog.com/2019/04/visualising-model-response-with-easyalluvial/ )
196
204
197
205
` easyalluvial ` contains wrappers for ` parsnip ` and ` caret ` models.
198
206
Custom Wrappers for other models can easily be created.
199
207
200
208
``` r
209
+
201
210
df = select(mtcars2 , - ids )
202
211
203
212
m = parsnip :: rand_forest(mode = " regression" ) %> %
@@ -216,11 +225,12 @@ p_grid = add_marginal_histograms(p, df, plot = F) %>%
216
225
### Interactive Partial Dependence Plot
217
226
218
227
``` r
228
+
219
229
parcats(p , marginal_histograms = TRUE , imp = TRUE , data_input = df )
220
230
```
221
231
222
- ![ demo] ( https://raw.githubusercontent.com/erblast/parcats/master/man/figures/demo2.gif )
223
- - ** [ Live
232
+ ![ demo] ( https://raw.githubusercontent.com/erblast/parcats/master/man/figures/demo2.gif ) -
233
+ ** [ Live
224
234
Widget] ( https://erblast.github.io/parcats/articles/parcats.html ) **
225
235
226
236
# ClinicoPath {jamovi} Module
@@ -232,7 +242,7 @@ interface for doing statistics with `R`.
232
242
233
243
# Similar Packages
234
244
235
- - [ ` ggalluvial ` ] ( https://github.com/corybrunson/ggalluvial/ )
236
- - [ ` alluvial ` ] ( https://github.com/mbojan/alluvial )
237
- - [ ` networkD3 ` ] ( https://github.com/christophergandrud/networkD3 )
238
- - [ ` ggbump ` ] ( https://github.com/davidsjoberg/ggbump )
245
+ - [ ` ggalluvial ` ] ( https://github.com/corybrunson/ggalluvial/ )
246
+ - [ ` alluvial ` ] ( https://github.com/mbojan/alluvial )
247
+ - [ ` networkD3 ` ] ( https://github.com/christophergandrud/networkD3 )
248
+ - [ ` ggbump ` ] ( https://github.com/davidsjoberg/ggbump )
0 commit comments