Skip to content

Commit c327f1c

Browse files
authored
Merge pull request #33 from erblast/issue_30
prep release 0.3.2
2 parents 0993abb + 93818bd commit c327f1c

19 files changed

+77
-670
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: easyalluvial
22
Title: Generate Alluvial Plots with a Single Line of Code
3-
Version: 0.3.1.900
3+
Version: 0.3.2
44
Authors@R: person( "Bjoern", "Koneswarakantha", role = c("aut","cre"), email = "datistics@gmail.com", comment = c(ORCID = "0000-0003-4585-7799") )
55
URL: https://github.com/erblast/easyalluvial/
66
Description: Alluvial plots are similar to sankey diagrams and visualise categorical data

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Version 0.3.2 submitted to CRAN 20231207
2+
- check for vip pkg installation before executing example of alluvial_model_response_parsnip
3+
- option for using geom_text instead of geom_label (by https://github.com/gernophil)
4+
15
# Version 0.3.1 submitted to CRAN 20220704
26
- cleanup package dependencies
37

R/alluvial_model_response.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ tidy_imp = function(imp, df, .f = max, resp_var = NULL){
236236
#' \code{\link[easyalluvial]{manip_bin_numerics}}, while leaving categoric
237237
#' variables unchanged. The number of bins for each numeric variable is set to
238238
#' bins -2. Next the median is picked for each of the bins and the min and the
239-
#' max value is added for each numeric variable So that we get { median(bin) X
240-
#' bins -2, max, min} for each numeric variable. Then all possible combinations
239+
#' max value is added for each numeric variable So that we get (median(bin) X
240+
#' bins -2, max, min) for each numeric variable. Then all possible combinations
241241
#' between those values and the categoric factor levels are created. The total
242242
#' number of all possible combinations defines the range of the data space. The
243243
#' values of the remaining variables are set to mode(factors) or

R/alluvial_wide.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ alluvial_wide = function( data
395395

396396
data_key = data_new %>%
397397
mutate( alluvial_id = manip_factor_2_numeric(alluvial_id) ) %>%
398-
left_join( data_alluvial ) %>%
398+
left_join( data_alluvial, relationship = "many-to-many" ) %>%
399399
select( - fill_flow, -fill_value, -fill ) %>%
400400
spread( key = x, value = value ) %>%
401401
select( one_of(id_str, variables, 'alluvial_id', 'n' ) ) %>%

README.Rmd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ knitr::opts_chunk$set(
1717

1818
# easyalluvial <a href='https://erblast.github.io/easyalluvial'><img src='man/figures/logo.png' align="right" height="139" /></a>
1919

20-
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/erblast/easyalluvial?branch=master&svg=true)](https://ci.appveyor.com/project/erblast/easyalluvial)
2120
[![R build status](https://github.com/erblast/easyalluvial/workflows/R-CMD-check/badge.svg)](https://github.com/erblast/easyalluvial/actions)
2221
[![Coverage Status](https://img.shields.io/codecov/c/github/erblast/easyalluvial/master.svg)](https://codecov.io/github/erblast/easyalluvial?branch=master)
2322
[![CRAN last release](https://www.r-pkg.org/badges/last-release/easyalluvial)](https://CRAN.R-project.org/package=easyalluvial)

README.md

Lines changed: 55 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
# easyalluvial <a href='https://erblast.github.io/easyalluvial'><img src='man/figures/logo.png' align="right" height="139" /></a>
55

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)
86
[![R build
97
status](https://github.com/erblast/easyalluvial/workflows/R-CMD-check/badge.svg)](https://github.com/erblast/easyalluvial/actions)
108
[![Coverage
@@ -37,17 +35,17 @@ for data exploration.
3735

3836
## Features
3937

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)**
5149

5250
## Installation
5351

@@ -60,19 +58,20 @@ install.packages('easyalluvial')
6058
### Development Version
6159

6260
``` r
61+
6362
# install.packages("devtools")
6463
devtools::install_github("erblast/easyalluvial")
6564
```
6665

6766
## Documentation
6867

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)
7675

7776
## Examples
7877

@@ -86,6 +85,7 @@ suppressPackageStartupMessages( require(easyalluvial) )
8685
#### Sample Data
8786

8887
``` r
88+
8989
knitr::kable( head(mtcars2) )
9090
```
9191

@@ -102,13 +102,14 @@ knitr::kable( head(mtcars2) )
102102

103103
Continuous Variables will be automatically binned as follows.
104104

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)
110110

111111
``` r
112+
112113
alluvial_wide( data = mtcars2
113114
, max_variables = 5
114115
, fill_by = 'first_variable' )
@@ -124,18 +125,19 @@ alluvial_wide( data = mtcars2
124125
knitr::kable( head(quarterly_flights) )
125126
```
126127

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 |
135136

136137
#### Plot
137138

138139
``` r
140+
139141
alluvial_long( quarterly_flights
140142
, key = qu
141143
, value = mean_arr_delay
@@ -159,17 +161,23 @@ alluvial_wide( data = mtcars2
159161
### Interactive Graphs
160162

161163
``` r
164+
162165
suppressPackageStartupMessages( require(parcats) )
163166

164167
p = alluvial_wide(mtcars2, max_variables = 5)
165168

166169
parcats(p, marginal_histograms = TRUE, data_input = mtcars2)
167170
```
168171

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>
170178

171-
- **[Live
172-
Widget](https://erblast.github.io/parcats/articles/parcats.html)**
179+
- **[Live
180+
Widget](https://erblast.github.io/parcats/articles/parcats.html)**
173181

174182
### Partial Dependence Alluvial Plots
175183

@@ -190,14 +198,15 @@ in the end. Each of the possible combinations is plotted as a flow which
190198
is coloured by the bin corresponding to the average model response
191199
generated by that particular combination.
192200

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/)
196204

197205
`easyalluvial` contains wrappers for `parsnip` and `caret` models.
198206
Custom Wrappers for other models can easily be created.
199207

200208
``` r
209+
201210
df = select(mtcars2, -ids)
202211

203212
m = parsnip::rand_forest(mode = "regression") %>%
@@ -216,11 +225,12 @@ p_grid = add_marginal_histograms(p, df, plot = F) %>%
216225
### Interactive Partial Dependence Plot
217226

218227
``` r
228+
219229
parcats(p, marginal_histograms = TRUE, imp = TRUE, data_input = df)
220230
```
221231

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
224234
Widget](https://erblast.github.io/parcats/articles/parcats.html)**
225235

226236
# ClinicoPath {jamovi} Module
@@ -232,7 +242,7 @@ interface for doing statistics with `R`.
232242

233243
# Similar Packages
234244

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)

appveyor.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

cran-comments.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
# Resubmission after being archived on CRAN
22

3-
clean up package dependencies
3+
All suggested dependencies were already controlled for, meaning there was a
4+
check in place that would raise an error with a message to install the missing
5+
package. Those are limited to functions most users will not use.
6+
7+
All unit tests would skip if suggested packages were missing.
8+
9+
One example missed a check for a suggested package installation which was added:
10+
11+
- check for vip pkg installation before executing example of alluvial_model_response_parsnip
412

513
## Test Environments
6-
* local macOS M1 R 4.2.1
7-
* Appveyor x86_64-w64-mingw32/x64 (64-bit) R 4.2.1
8-
* github actions macos-latest R 4.2.1
9-
* WinBuilder R 4.2.1
14+
* local macOS M1 R 4.3.2
15+
* github actions macos-latest R 4.3.2
16+
* WinBuilder R 4.3.2
1017
* WinBuilder R devel
1118

1219
coverage -> 96 %

man/figures/README-plot_long-1.png

1004 Bytes
Loading
2.38 KB
Loading
30.6 KB
Loading

man/figures/README-wide_plot-1.png

2.88 KB
Loading

man/get_data_space.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)