Skip to content

Commit

Permalink
Merge pull request #18 from erblast/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
erblast committed May 5, 2020
2 parents 211fe71 + c75eb37 commit 45cce1c
Show file tree
Hide file tree
Showing 40 changed files with 986 additions and 145 deletions.
7 changes: 7 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@
^README\.Rmd$
^README-.*\.png$
^cran-comments\.md$
^docker-compose\.yml$
^docker$
^_pkgdown\.yml$
^docs$
^pkgdown$
^vignettes$
^tests/figs/$
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
.Ruserdata
dependencies/
revdep/
docs/
*.rdx
*.RData
*.rdb
vignettes/model_response_cache/
13 changes: 12 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

language: R
R:
- 3.5.3
- 3.6.3
sudo: false
cache: packages

Expand All @@ -16,6 +16,17 @@ matrix:
- r: release
after_success:
- Rscript -e 'covr::codecov()'
- Rscript -e 'pkgdown::build_site(run_dont_run = TRUE)'
- r: release
name: tidyr-devel
before_script: Rscript -e "remotes::install_github('tidyverse/tidyr')"
- r: release
name: dplyr-devel
before_script: Rscript -e "remotes::install_github('tidyverse/dplyr')"

deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
keep_history: true
local-dir: docs
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: easyalluvial
Title: Generate Alluvial Plots with a Single Line of Code
Version: 0.2.2.900
Version: 0.2.3
Authors@R: person( "Bjoern", "Koneswarakantha", role = c("aut","cre"), email = "datistics@gmail.com", comment = c(ORCID = "0000-0003-4585-7799") )
URL: https://github.com/erblast/easyalluvial
Description: Alluvial plots are similar to sankey diagrams and visualise categorical data
Expand All @@ -25,8 +25,9 @@ Suggests:
covr,
ISLR,
nycflights13,
vdiffr (>= 0.3.1)
RoxygenNote: 7.0.0
vdiffr (>= 0.3.1),
parcats
RoxygenNote: 7.1.0
Imports:
purrr
, tidyr (>= 1.0.0)
Expand Down
1 change: 1 addition & 0 deletions R/alluvial_model_response.R
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ alluvial_model_response_caret = function(train, degree = 4, bins = 5
#' @return OUTPUT_DESCRIPTION
#' @seealso \code{\link[e1071]{skewness}}
#' @rdname use_e1071
#' @noRd
#' @importFrom e1071 skewness
use_e1071 = function(x){
e1071::skewness(x)
Expand Down
1 change: 1 addition & 0 deletions R/manip.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ manip_bin_numerics = function(x

join_by = names(df_min)[! names(df_min) %in% numerics ]
join_by = c(join_by, 'easyalluvialid')
join_by = unique(join_by)

data_new = df_min %>%
left_join(df_max, by = join_by )
Expand Down
15 changes: 10 additions & 5 deletions R/plot_marginal_hist.R
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ plot_hist_model_response = function(var, p, data_input, pred_train = NULL, scale
}

if( ! is_num & is_pred){

var_str = ori_name

df_input = data_input %>%
Expand All @@ -259,13 +258,19 @@ plot_hist_model_response = function(var, p, data_input, pred_train = NULL, scale
select( x, value ) %>%
rename( variable = x) %>%
mutate( variable = as.character(variable)
, value = fct_drop(value) )
, value = fct_drop(value)
# p$data does not preserve factor order
, value = fct_relevel(value, levels(df_input$value) ) )

stopifnot(all(levels(df_input$value) == levels(df_resp$value)))

if(is.ordered(df_input$value)){
df_resp$value = as.ordered(df_resp$value)
}

df_plot = df_input %>%
bind_rows(df_resp)

# df_plot = df_input


if( ! is_null(pred_train) ){
df_plot = df_plot %>%
bind_rows( tibble(variable = 'pred_train'
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Status](https://ci.appveyor.com/api/projects/status/github/erblast/easyalluvial?

[![Coverage Status](https://img.shields.io/codecov/c/github/erblast/easyalluvial/master.svg)](https://codecov.io/github/erblast/easyalluvial?branch=master)
[![CRAN last release](https://www.r-pkg.org/badges/last-release/easyalluvial)](https://CRAN.R-project.org/package=easyalluvial)
[![CRAN monthly downloads](https://cranlogs.r-pkg.org/badges/easyalluvial)](https://cran.r-project.org/package=easyalluvial)
[![CRAN total downloads](https://cranlogs.r-pkg.org/badges/grand-total/easyalluvial)](https://CRAN.R-project.org/package=easyalluvial)


Expand Down
55 changes: 55 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
navbar:
structure:
left:
- home
- reference
- articles
- news
right: github
components:
home:
icon: fas fa-home fa-lg
href: index.html
reference:
text: Reference
href: reference/index.html
news:
text: Changelog
href: news/index.html
template:
params:
ganalytics: UA-123997499-2
url: https://erblast.github.io/easyalluvial/
reference:
- title: Main Plot Functions
desc: ~
contents:
- starts_with("alluvial")
- title: Add Plot Elements
desc: ~
contents:
- starts_with("add_")
- title: Generate Data for Model Response and Partial Dependence Plots
desc: ~
contents:
- starts_with("get_")
- title: Helper Functions - Data Manipulation
desc: ~
contents:
- starts_with("manip_")
- tidy_imp
- title: Helper Functions - Plotting
desc: ~
contents:
- starts_with("plot_")
- title: Helper Functions - Color Palette
desc: ~
contents:
- starts_with("palette_")
- title: Data Sets
desc: ~
contents:
- mtcars2
- titanic
- quarterly_flights
- quarterly_sunspots
47 changes: 47 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

version: '3.7'
services:
build_latest:
build:
context: .
dockerfile: docker/latest.dockerfile
image: 'easyalluvial_latest'

build_devel:
build:
context: .
dockerfile: docker/devel.dockerfile
image: 'easyalluvial_devel'

rstudio_latest:
image: 'easyalluvial_latest'
ports:
- '8787:8787'
volumes:
- '.:/home/rstudio/easyalluvial'
command: /init
environment:
PASSWORD: '123'
USER: 'rstudio'

rstudio_devel:
image: 'easyalluvial_devel'
ports:
- '8888:8787'
volumes:
- '.:/home/rstudio/easyalluvial'
command: /init
environment:
PASSWORD: '123'
USER: 'rstudio'

check_devel:
image: 'easyalluvial_devel'
volumes:
- '.:/home/rstudio/easyalluvial'

check_latest:
image: 'easyalluvial_latest'
volumes:
- '.:/home/rstudio/easyalluvial'

11 changes: 11 additions & 0 deletions docker/devel.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM rocker/verse:devel
COPY * /home/rstudio/easyalluvial/
WORKDIR '/home/rstudio/easyalluvial/'
RUN R -e "devtools::install_dev_deps('.', upgrade = 'never')"
RUN git clone https://github.com/erblast/parcats.git /home/rstudio/parcats
RUN git clone https://github.com/tidyverse/tidyr.git /home/rstudio/tidyr
RUN git clone https://github.com/tidyverse/dplyr.git /home/rstudio/dplyr
RUN R -e "devtools::install('/home/rstudio/tidyr')"
RUN R -e "devtools::install('/home/rstudio/dplyr')"
RUN R -e "devtools::install('/home/rstudio/parcats')"
CMD R -e "devtools::check('.')" -e "devtools::install('.')" -e "devtools::check('/home/rstudio/parcats')"
7 changes: 7 additions & 0 deletions docker/latest.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM rocker/verse:latest
COPY * /home/rstudio/easyalluvial/
WORKDIR '/home/rstudio/easyalluvial/'
RUN R -e "devtools::install_dev_deps('.', upgrade = 'never')"
RUN R -e "remotes::install_cran('parcats', upgrade= 'never')"
RUN git clone https://github.com/erblast/parcats.git /home/rstudio/parcats
CMD R -e "devtools::check('.')" -e "devtools::install('.')" -e "devtools::check('/home/rstudio/parcats')"
2 changes: 1 addition & 1 deletion man/add_imp_plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/alluvial_long.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/mtcars2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/palette_filter.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/palette_plot_intensity.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/palette_plot_rgp.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/plot_imp.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/quarterly_flights.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/quarterly_sunspots.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 45cce1c

Please sign in to comment.