From 6c45edfaf61d3c54531180fb22ab6e27c6611ce3 Mon Sep 17 00:00:00 2001 From: rsquaredin Date: Thu, 28 Feb 2019 11:07:21 +0530 Subject: [PATCH 1/4] closes #14 --- DESCRIPTION | 4 +- NAMESPACE | 5 +++ R/launch.R | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ R/utils.R | 12 +++--- R/xplorerr.R | 5 ++- R/zzz.R | 13 ++++--- docs/index.html | 13 ++++++- 7 files changed, 136 insertions(+), 15 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d49aba7..e2cbe83 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -10,7 +10,9 @@ Description: Tools for interactive data exploration built using 'shiny'. Include Depends: R(>= 3.2.4) Imports: - shiny + magrittr, + shiny, + utils Suggests: blorr, descriptr, diff --git a/NAMESPACE b/NAMESPACE index b45d37f..5dd8f6e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -7,3 +7,8 @@ export(app_logistic_regression) export(app_rfm_analysis) export(app_vistributions) export(app_visualizer) +importFrom(magrittr,"%>%") +importFrom(magrittr,extract) +importFrom(utils,install.packages) +importFrom(utils,menu) +importFrom(utils,packageVersion) diff --git a/R/launch.R b/R/launch.R index 685b428..2bcff70 100644 --- a/R/launch.R +++ b/R/launch.R @@ -7,6 +7,28 @@ #' @export #' app_visualizer <- function() { + + check_suggests(shiny) + check_suggests(shinyBS) + check_suggests(shinythemes) + check_suggests(descriptr) + check_suggests(dplyr) + check_suggests(ggplot2) + check_suggests(plotly) + check_suggests(rbokeh) + check_suggests(highcharter) + check_suggests(purrr) + check_suggests(tidyr) + check_suggests(tibble) + check_suggests(readxl) + check_suggests(readr) + check_suggests(jsonlite) + check_suggests(magrittr) + check_suggests(tools) + check_suggests(lubridate) + check_suggests(scales) + check_suggests(stringr) + message('Highcharts (www.highcharts.com) is a Highsoft software product which is not free for commercial and Governmental use') shiny::runApp(appDir = system.file("app-visualize", package = "xplorerr")) } @@ -20,7 +42,20 @@ app_visualizer <- function() { #' @export #' app_descriptive <- function() { + + check_suggests('descriptr') + check_suggests('haven') + check_suggests('jsonlite') + check_suggests('readr') + check_suggests('readxl') + check_suggests('shinyBS') + check_suggests('shinycssloaders') + check_suggests('shinythemes') + check_suggests('stringr') + check_suggests('lubridate') + shiny::runApp(appDir = system.file("app-descriptr", package = "xplorerr")) + } #' @title Visualize distributions @@ -32,7 +67,14 @@ app_descriptive <- function() { #' @export #' app_vistributions <- function() { + + check_suggests('vistributions') + check_suggests('shinyBS') + check_suggests('shinycssloaders') + check_suggests('shinythemes') + shiny::runApp(appDir = system.file("app-vistributions", package = "xplorerr")) + } @@ -45,7 +87,21 @@ app_vistributions <- function() { #' @export #' app_inference <- function() { + + check_suggests('inferr') + check_suggests('descriptr') + check_suggests('jsonlite') + check_suggests('haven') + check_suggests('lubridate') + check_suggests('readr') + check_suggests('readxl') + check_suggests('shinyBS') + check_suggests('shinycssloaders') + check_suggests('shinythemes') + check_suggests('stringr') + shiny::runApp(appDir = system.file("app-inferr", package = "xplorerr")) + } #' @title Linear Regression @@ -57,7 +113,22 @@ app_inference <- function() { #' @export #' app_linear_regression <- function() { + + check_suggests('olsrr') + check_suggests('caret') + check_suggests('descriptr') + check_suggests('jsonlite') + check_suggests('haven') + check_suggests('lubridate') + check_suggests('readr') + check_suggests('readxl') + check_suggests('scales') + check_suggests('shinyBS') + check_suggests('shinycssloaders') + check_suggests('shinythemes') + shiny::runApp(appDir = system.file("app-olsrr", package = "xplorerr")) + } #' @title Logistic Regression @@ -69,7 +140,22 @@ app_linear_regression <- function() { #' @export #' app_logistic_regression <- function() { + + check_suggests('blorr') + check_suggests('descriptr') + check_suggests('jsonlite') + check_suggests('haven') + check_suggests('lubridate') + check_suggests('readr') + check_suggests('readxl') + check_suggests('shinyBS') + check_suggests('shinycssloaders') + check_suggests('shinythemes') + check_suggests('stringr') + check_suggests('tidyr') + shiny::runApp(appDir = system.file("app-blorr", package = "xplorerr")) + } #' @title RFM Analysis @@ -81,7 +167,20 @@ app_logistic_regression <- function() { #' @export #' app_rfm_analysis <- function() { + + check_suggests('rfm') + check_suggests('haven') + check_suggests('jsonlite') + check_suggests('readr') + check_suggests('readxl') + check_suggests('shinyBS') + check_suggests('shinycssloaders') + check_suggests('shinythemes') + check_suggests('stringr') + check_suggests('DT') + shiny::runApp(appDir = system.file("app-rfm", package = "xplorerr")) + } diff --git a/R/utils.R b/R/utils.R index d69b78e..f088dbc 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1,12 +1,12 @@ -#' @importFrom utils packageVersion, menu, install.packages +#' @importFrom utils packageVersion menu install.packages check_suggests <- function(pkg) { - + pkg_flag <- tryCatch(utils::packageVersion(pkg), error = function(e) NA) - + if (is.na(pkg_flag)) { - + msg <- message(paste0(pkg, ' must be installed for this functionality.')) - + if (interactive()) { message(msg, "\nWould you like to install it?") if (utils::menu(c("Yes", "No")) == 1) { @@ -16,7 +16,7 @@ check_suggests <- function(pkg) { } } else { stop(msg, call. = FALSE) - } + } } } diff --git a/R/xplorerr.R b/R/xplorerr.R index 3fa9e1d..8d0616d 100644 --- a/R/xplorerr.R +++ b/R/xplorerr.R @@ -10,4 +10,7 @@ NULL ## quiets concerns of R CMD check re: the .'s that appear in pipelines -if(getRversion() >= "2.15.1") utils::globalVariables(c(".")) \ No newline at end of file +if(getRversion() >= "2.15.1") utils::globalVariables(c(".", + "descriptr", "dplyr", "ggplot2", "highcharter", "jsonlite", "lubridate", + "magrittr", "plotly", "purrr", "rbokeh", "readr", "readxl", "scales", + "shiny", "shinyBS", "shinythemes", "stringr", "tibble", "tidyr", "tools")) diff --git a/R/zzz.R b/R/zzz.R index a711029..a2aa348 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,9 +1,10 @@ +#' @importFrom magrittr %>% extract .onAttach <- function(...) { if (!interactive() || stats::runif(1) > 0.1) return() pkgs <- utils::available.packages() - - cran_version <- + + cran_version <- pkgs %>% extract("xplorerr", "Version") %>% package_version() @@ -23,14 +24,14 @@ if (interactive()) { if (behind_cran) { - msg <- message("A new version of xplorerr is available with bug fixes and new features.") - message(msg, "\nWould you like to install it?") + msg <- c("A new version of xplorerr is available with bug fixes and new features.") + packageStartupMessage(msg, "\nWould you like to install it?") if (utils::menu(c("Yes", "No")) == 1) { utils::update.packages("xplorerr") - } + } } else { packageStartupMessage(paste(strwrap(tip), collapse = "\n")) - } + } } } diff --git a/docs/index.html b/docs/index.html index 579329a..4ccd4ad 100644 --- a/docs/index.html +++ b/docs/index.html @@ -34,7 +34,18 @@ - + + + + + From fce7926fdef45bb097c33d32acb16a95429e775e Mon Sep 17 00:00:00 2001 From: rsquaredin Date: Thu, 28 Feb 2019 13:57:28 +0530 Subject: [PATCH 2/4] ds_freq_cont has been deprecated --- inst/app-descriptr/logic/logic_freq_quant.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/app-descriptr/logic/logic_freq_quant.R b/inst/app-descriptr/logic/logic_freq_quant.R index 70283f5..ef93f7a 100644 --- a/inst/app-descriptr/logic/logic_freq_quant.R +++ b/inst/app-descriptr/logic/logic_freq_quant.R @@ -102,7 +102,7 @@ fil_quant_data <- reactive({ }) fquant_out <- eventReactive(input$submit_fquant, { - ko <- ds_freq_cont(fil_quant_data(), + ko <- ds_freq_table(fil_quant_data(), !! sym(as.character(input$var_freq_quant)), input$bins) ko From ba662c6c3dec05c8048efacec05cbd08090dbb44 Mon Sep 17 00:00:00 2001 From: rsquaredin Date: Thu, 28 Feb 2019 13:57:49 +0530 Subject: [PATCH 3/4] fix navigation to eda tab --- inst/app-descriptr/logic/logic_screen.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/app-descriptr/logic/logic_screen.R b/inst/app-descriptr/logic/logic_screen.R index d1e9269..51faa21 100644 --- a/inst/app-descriptr/logic/logic_screen.R +++ b/inst/app-descriptr/logic/logic_screen.R @@ -4,8 +4,8 @@ output$screen <- renderPrint({ }) observeEvent(input$finalok, { - updateNavbarPage(session, 'mainpage', selected = 'tab_home_analyze') - updateNavlistPanel(session, 'navlist_home', 'tab_analyze_home') + updateNavbarPage(session, 'mainpage', selected = 'tab_eda') + # updateNavlistPanel(session, 'navlist_eda', 'tab_eda') }) final_split <- reactiveValues(train = NULL) From 494cd3e698737ac6aef5365289ffc487fe4b40fd Mon Sep 17 00:00:00 2001 From: rsquaredin Date: Thu, 28 Feb 2019 15:59:12 +0530 Subject: [PATCH 4/4] on cran --- DESCRIPTION | 2 +- NEWS.md | 7 + README.Rmd | 6 +- cran-comments.md | 12 +- docs/CNAME | 1 + docs/CONDUCT.html | 2 +- docs/LICENSE-text.html | 2 +- docs/LICENSE.html | 2 +- docs/authors.html | 2 +- docs/docsearch.css | 31 +-- docs/docsearch.js | 85 +++++++ docs/index.html | 3 +- docs/news/index.html | 42 ++-- docs/pkgdown.css | 17 +- docs/pkgdown.js | 237 ++++++++------------ docs/pkgdown.yml | 4 +- docs/reference/app_descriptive.html | 28 ++- docs/reference/app_inference.html | 28 ++- docs/reference/app_linear_regression.html | 28 ++- docs/reference/app_logistic_regression.html | 28 ++- docs/reference/app_rfm_analysis.html | 28 ++- docs/reference/app_vistributions.html | 23 +- docs/reference/app_visualizer.html | 28 ++- docs/reference/index.html | 2 +- docs/reference/xplorerr.html | 28 ++- docs/sitemap.xml | 3 + 26 files changed, 383 insertions(+), 296 deletions(-) create mode 100644 docs/CNAME create mode 100644 docs/docsearch.js diff --git a/DESCRIPTION b/DESCRIPTION index e2cbe83..5ff23a2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: xplorerr Type: Package Title: Tools for Interactive Data Exploration -Version: 0.1.0.9000 +Version: 0.1.1 Authors@R: person("Aravind", "Hebbali", email = "hebbali.aravind@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-9220-9669")) Description: Tools for interactive data exploration built using 'shiny'. Includes apps for descriptive diff --git a/NEWS.md b/NEWS.md index fe14f68..2078264 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,10 @@ +# xplorerr 0.1.1 + +This is a patch release to fix bugs. + +- Check suggested packages ([#14](https://github.com/rsquaredacademy/xplorerr/issues/14)) +- Screening error ([#16](https://github.com/rsquaredacademy/xplorerr/issues/16)) + # xplorerr 0.1.0 First release diff --git a/README.Rmd b/README.Rmd index aa9b12d..0f0b637 100644 --- a/README.Rmd +++ b/README.Rmd @@ -17,10 +17,8 @@ knitr::opts_chunk$set( > Tools for interactive data analysis [![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/xplorerr)](https://cran.r-project.org/package=xplorerr) -[![cran checks](https://cranchecks.info/badges/summary/xplorerr)](https://cran.r-project.org/web/checks/check_results_xplorerr.html) [![Travis-CI Build Status](https://travis-ci.org/rsquaredacademy/xplorerr.svg?branch=master)](https://travis-ci.org/rsquaredacademy/xplorerr) -[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/rsquaredacademy/xplorerr?branch=master&svg=true)](https://ci.appveyor.com/project/rsquaredacademy/xplorerr) -[![](https://cranlogs.r-pkg.org/badges/grand-total/xplorerr)](https://cran.r-project.org/package=xplorerr) -[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing) +[![cran checks](https://cranchecks.info/badges/summary/xplorerr)](https://cran.r-project.org/web/checks/check_results_xplorerr.html) +[![Travis-CI Build Status](https://travis-ci.org/rsquaredacademy/xplorerr.svg?branch=master)](https://travis-ci.org/rsquaredacademy/xplorerr) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/rsquaredacademy/xplorerr?branch=master&svg=true)](https://ci.appveyor.com/project/rsquaredacademy/xplorerr) [![](https://cranlogs.r-pkg.org/badges/grand-total/xplorerr)](https://cran.r-project.org/package=xplorerr) [![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing) ## Overview diff --git a/cran-comments.md b/cran-comments.md index bef3b70..4b837cb 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,15 +1,9 @@ ## Test environments -* local Windows 10, R 3.5.1 -* ubuntu 14.04 (on travis-ci), R 3.4.4, R 3.5.1, R devel +* local Windows 10, R 3.5.2 +* ubuntu 14.04 (on travis-ci), R 3.4.4, R 3.5.2, R devel * win-builder (devel and release) ## R CMD check results -0 errors | 0 warnings | 1 note - -* This is a new release. - -## Reverse dependencies - -This is a new release, so there are no reverse dependencies. +0 errors | 0 warnings | 0 note diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..3c53eac --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +xplorerr.rsquaredacademy.com diff --git a/docs/CONDUCT.html b/docs/CONDUCT.html index 03d3ec3..ed8628e 100644 --- a/docs/CONDUCT.html +++ b/docs/CONDUCT.html @@ -60,7 +60,7 @@ xplorerr - 0.1.0.9000 + 0.1.1 diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 8837e4f..0948b47 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -60,7 +60,7 @@ xplorerr - 0.1.0.9000 + 0.1.1 diff --git a/docs/LICENSE.html b/docs/LICENSE.html index b0bfbc0..f2fee35 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -60,7 +60,7 @@ xplorerr - 0.1.0.9000 + 0.1.1 diff --git a/docs/authors.html b/docs/authors.html index 66d2183..2057672 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -60,7 +60,7 @@ xplorerr - 0.1.0.9000 + 0.1.1 diff --git a/docs/docsearch.css b/docs/docsearch.css index c524034..e5f1fe1 100644 --- a/docs/docsearch.css +++ b/docs/docsearch.css @@ -111,23 +111,26 @@ } .algolia-autocomplete .algolia-docsearch-footer { - float: none; - width: auto; - height: auto; - padding: .75rem 1rem 0; - font-size: .95rem; - line-height: 1; - color: #767676; - background-color: rgb(255, 255, 255); - border-top: 1px solid rgba(0, 0, 0, .1) + width: 110px; + height: 20px; + z-index: 3; + margin-top: 10.66667px; + float: right; + font-size: 0; + line-height: 0; } .algolia-autocomplete .algolia-docsearch-footer--logo { - display: inline; - overflow: visible; - color: inherit; - text-indent: 0; - background: 0 0 + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: 50%; + background-size: 100%; + overflow: hidden; + text-indent: -9000px; + width: 100%; + height: 100%; + display: block; + transform: translate(-8px); } .algolia-autocomplete .algolia-docsearch-suggestion--highlight { diff --git a/docs/docsearch.js b/docs/docsearch.js new file mode 100644 index 0000000..b35504c --- /dev/null +++ b/docs/docsearch.js @@ -0,0 +1,85 @@ +$(function() { + + // register a handler to move the focus to the search bar + // upon pressing shift + "/" (i.e. "?") + $(document).on('keydown', function(e) { + if (e.shiftKey && e.keyCode == 191) { + e.preventDefault(); + $("#search-input").focus(); + } + }); + + $(document).ready(function() { + // do keyword highlighting + /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ + var mark = function() { + + var referrer = document.URL ; + var paramKey = "q" ; + + if (referrer.indexOf("?") !== -1) { + var qs = referrer.substr(referrer.indexOf('?') + 1); + var qs_noanchor = qs.split('#')[0]; + var qsa = qs_noanchor.split('&'); + var keyword = ""; + + for (var i = 0; i < qsa.length; i++) { + var currentParam = qsa[i].split('='); + + if (currentParam.length !== 2) { + continue; + } + + if (currentParam[0] == paramKey) { + keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); + } + } + + if (keyword !== "") { + $(".contents").unmark({ + done: function() { + $(".contents").mark(keyword); + } + }); + } + } + }; + + mark(); + }); +}); + +/* Search term highlighting ------------------------------*/ + +function matchedWords(hit) { + var words = []; + + var hierarchy = hit._highlightResult.hierarchy; + // loop to fetch from lvl0, lvl1, etc. + for (var idx in hierarchy) { + words = words.concat(hierarchy[idx].matchedWords); + } + + var content = hit._highlightResult.content; + if (content) { + words = words.concat(content.matchedWords); + } + + // return unique words + var words_uniq = [...new Set(words)]; + return words_uniq; +} + +function updateHitURL(hit) { + + var words = matchedWords(hit); + var url = ""; + + if (hit.anchor) { + url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; + } else { + url = hit.url + '?q=' + escape(words.join(" ")); + } + + return url; +} diff --git a/docs/index.html b/docs/index.html index 4ccd4ad..d221b37 100644 --- a/docs/index.html +++ b/docs/index.html @@ -35,6 +35,7 @@ + + - - + + - + - + + + + - @@ -31,8 +33,10 @@ + - + + - + @@ -9,21 +9,23 @@ Descriptive Statistics — app_descriptive • xplorerr - + - - + + - + - + + + + - @@ -34,8 +36,10 @@ + - + + - + @@ -9,21 +9,23 @@ Inferential Statistics — app_inference • xplorerr - + - - + + - + - + + + + - @@ -34,8 +36,10 @@ + - + + - + @@ -9,21 +9,23 @@ Linear Regression — app_linear_regression • xplorerr - + - - + + - + - + + + + - @@ -34,8 +36,10 @@ + - + + - + @@ -9,21 +9,23 @@ Logistic Regression — app_logistic_regression • xplorerr - + - - + + - + - + + + + - @@ -34,8 +36,10 @@ + - + + - + @@ -9,21 +9,23 @@ RFM Analysis — app_rfm_analysis • xplorerr - + - - + + - + - + + + + - @@ -34,8 +36,10 @@ + - + + - + @@ -9,17 +9,17 @@ Visualize distributions — app_vistributions • xplorerr - + - - + + - + - + @@ -38,7 +38,8 @@ - + + - + @@ -9,21 +9,23 @@ Visualization — app_visualizer • xplorerr - + - - + + - + - + + + + - @@ -34,8 +36,10 @@ + - + + - + @@ -9,21 +9,23 @@ <code>xplorerr</code> package — xplorerr • xplorerr - + - - + + - + - + + + + - @@ -34,8 +36,10 @@ + - + +