diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index b0f3cd6..3cdf68c 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,16 +1,14 @@ -# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. -# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - branches: - - master - - develop + branches: [master, develop] pull_request: - branches: - - master - - develop + branches: [master, develop] -name: R-CMD-check +name: R-CMD-check.yaml + +permissions: read-all jobs: R-CMD-check: @@ -22,63 +20,33 @@ jobs: fail-fast: false matrix: config: + - {os: macos-latest, r: 'release'} - {os: windows-latest, r: 'release'} - - {os: macOS-latest, r: 'release'} - - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - RSPM: ${{ matrix.config.rspm }} GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true - - uses: r-lib/actions/setup-pandoc@v1 - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} - - - name: Cache R packages - if: runner.os != 'Windows' - uses: actions/cache@v2 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - - name: Install system dependencies - if: runner.os == 'Linux' - run: | - while read -r cmd - do - eval sudo $cmd - done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') - - - name: Install dependencies - run: | - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("rcmdcheck") - shell: Rscript {0} - - - name: Check - env: - _R_CHECK_CRAN_INCOMING_REMOTE_: false - run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") - shell: Rscript {0} + extra-packages: any::rcmdcheck + needs: check - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main + - uses: r-lib/actions/check-r-package@v2 with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.github/workflows/rhub.yaml b/.github/workflows/rhub.yaml new file mode 100644 index 0000000..74ec7b0 --- /dev/null +++ b/.github/workflows/rhub.yaml @@ -0,0 +1,95 @@ +# R-hub's generic GitHub Actions workflow file. It's canonical location is at +# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml +# You can update this file to a newer version using the rhub2 package: +# +# rhub::rhub_setup() +# +# It is unlikely that you need to modify this file manually. + +name: R-hub +run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}" + +on: + workflow_dispatch: + inputs: + config: + description: 'A comma separated list of R-hub platforms to use.' + type: string + default: 'linux,windows,macos' + name: + description: 'Run name. You can leave this empty now.' + type: string + id: + description: 'Unique ID. You can leave this empty now.' + type: string + +jobs: + + setup: + runs-on: ubuntu-latest + outputs: + containers: ${{ steps.rhub-setup.outputs.containers }} + platforms: ${{ steps.rhub-setup.outputs.platforms }} + + steps: + # NO NEED TO CHECKOUT HERE + - uses: r-hub/actions/setup@v1 + with: + config: ${{ github.event.inputs.config }} + id: rhub-setup + + linux-containers: + needs: setup + if: ${{ needs.setup.outputs.containers != '[]' }} + runs-on: ubuntu-latest + name: ${{ matrix.config.label }} + strategy: + fail-fast: false + matrix: + config: ${{ fromJson(needs.setup.outputs.containers) }} + container: + image: ${{ matrix.config.container }} + + steps: + - uses: r-hub/actions/checkout@v1 + - uses: r-hub/actions/platform-info@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + - uses: r-hub/actions/setup-deps@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + - uses: r-hub/actions/run-check@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + + other-platforms: + needs: setup + if: ${{ needs.setup.outputs.platforms != '[]' }} + runs-on: ${{ matrix.config.os }} + name: ${{ matrix.config.label }} + strategy: + fail-fast: false + matrix: + config: ${{ fromJson(needs.setup.outputs.platforms) }} + + steps: + - uses: r-hub/actions/checkout@v1 + - uses: r-hub/actions/setup-r@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} + - uses: r-hub/actions/platform-info@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + - uses: r-hub/actions/setup-deps@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} + - uses: r-hub/actions/run-check@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml deleted file mode 100644 index 9245d3a..0000000 --- a/.github/workflows/test-coverage.yaml +++ /dev/null @@ -1,48 +0,0 @@ -on: - push: - branches: - - master - - develop - pull_request: - branches: - - master - - develop - -name: test-coverage - -jobs: - test-coverage: - runs-on: macOS-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-r@v1 - - - uses: r-lib/actions/setup-pandoc@v1 - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} - - - name: Cache R packages - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - - name: Install dependencies - run: | - install.packages(c("remotes")) - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("covr") - shell: Rscript {0} - - - name: Test coverage - run: covr::codecov() - shell: Rscript {0} diff --git a/DESCRIPTION b/DESCRIPTION index 67e17a9..754cb96 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: xplorerr Type: Package Title: Tools for Interactive Data Exploration -Version: 0.1.2.9000 +Version: 0.2.0 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 @@ -18,21 +18,18 @@ Suggests: data.table, descriptr, DT, - grid, haven, highcharter, jsonlite, - kableExtra, magrittr, olsrr, plotly, - rbokeh, readr, readxl, rfm, shinyBS, shinycssloaders, - shinythemes, + standby, tools, vistributions URL: https://github.com/rsquaredacademy/xplorerr, https://xplorerr.rsquaredacademy.com/ @@ -40,6 +37,6 @@ BugReports: https://github.com/rsquaredacademy/xplorerr/issues License: MIT + file LICENSE Encoding: UTF-8 LazyData: true -RoxygenNote: 7.1.1 +RoxygenNote: 7.3.2 LinkingTo: Rcpp diff --git a/NEWS.md b/NEWS.md index a6bc7f9..110d90a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# xplorerr 0.2.0 + +This is a minor release to fix CRAN note. + # xplorerr 0.1.2 This is a patch release to fix CRAN note about lazy data. diff --git a/R/launch.R b/R/launch.R index d5964fe..dd71c50 100644 --- a/R/launch.R +++ b/R/launch.R @@ -15,7 +15,6 @@ app_visualizer <- function() { check_suggests('dplyr') check_suggests('ggplot2') check_suggests('plotly') - check_suggests('rbokeh') check_suggests('highcharter') check_suggests('purrr') check_suggests('tidyr') @@ -62,7 +61,7 @@ app_descriptive <- function() { #' @description Launches app for visualizing probability distributions. #' @examples #' \dontrun{ -#' app_descriptive() +#' app_vistributions() #' } #' @export #' @@ -160,7 +159,7 @@ app_logistic_regression <- function() { } #' @title RFM Analysis -#' @description Launches the RFM analyssi app. +#' @description Launches the RFM analysis app. #' @examples #' \dontrun{ #' app_rfm_analysis() diff --git a/R/xplorerr.R b/R/xplorerr.R index e7a25e7..3c90536 100644 --- a/R/xplorerr.R +++ b/R/xplorerr.R @@ -6,10 +6,12 @@ #' \href{https://github.com/rsquaredacademy/xplorerr}{GitHub} #' #' @docType package +#' @keywords internal #' @importFrom Rcpp sourceCpp #' @useDynLib xplorerr #' @name xplorerr -NULL +#' @aliases xplorerr-package +"_PACKAGE" ## quiets concerns of R CMD check re: the .'s that appear in pipelines if(getRversion() >= "2.15.1") utils::globalVariables(c(".", diff --git a/README.Rmd b/README.Rmd index 61020c8..a3fe995 100644 --- a/README.Rmd +++ b/README.Rmd @@ -18,9 +18,7 @@ knitr::opts_chunk$set( [![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) -[![R build status](https://github.com/rsquaredacademy/xplorerr/workflows/R-CMD-check/badge.svg)](https://github.com/rsquaredacademy/xplorerr/actions) [![status](https://tinyverse.netlify.com/badge/xplorerr)](https://CRAN.R-project.org/package=xplorerr) [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html) -[![](https://cranlogs.r-pkg.org/badges/grand-total/xplorerr)](https://cran.r-project.org/package=xplorerr) +[![R-CMD-check](https://github.com/rsquaredacademy/xplorerr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rsquaredacademy/xplorerr/actions/workflows/R-CMD-check.yaml) ## Overview diff --git a/README.md b/README.md index 360c94a..d37aed8 100644 --- a/README.md +++ b/README.md @@ -7,32 +7,25 @@ -[![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) -[![R build -status](https://github.com/rsquaredacademy/xplorerr/workflows/R-CMD-check/badge.svg)](https://github.com/rsquaredacademy/xplorerr/actions) -[![status](https://tinyverse.netlify.com/badge/xplorerr)](https://CRAN.R-project.org/package=xplorerr) -[![Lifecycle: -stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html) -[![](https://cranlogs.r-pkg.org/badges/grand-total/xplorerr)](https://cran.r-project.org/package=xplorerr) +[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/xplorerr)](https://cran.r-project.org/package=xplorerr) +[![R-CMD-check](https://github.com/rsquaredacademy/xplorerr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rsquaredacademy/xplorerr/actions/workflows/R-CMD-check.yaml) ## Overview xplorerr provides a set of tools for interactive data analysis: -- Descriptive statistics -- Visualize probability distributions -- Inferential statistics -- Linear regression -- Logistic regression -- RFM Analysis -- Data visualization - - ggplot2 - - plotly - - rbokeh - - highcharter +- Descriptive statistics +- Visualize probability distributions +- Inferential statistics +- Linear regression +- Logistic regression +- RFM Analysis +- Data visualization + - ggplot2 + - plotly + - rbokeh + - highcharter ## Installation diff --git a/cran-comments.md b/cran-comments.md index a03a3be..20257fd 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,14 +1,3 @@ -## Resubmission - -* Fixed invalid URL (https://www.tidyverse.org/lifecycle/#stable to -https://lifecycle.r-lib.org/articles/stages.html) - -## Test environments -* local Windows 10 install, R 4.0.4 -* ubuntu 14.04 (on GitHub Actions), R 4.1.0, R-devel -* win-builder (devel and release) - ## R CMD check results 0 errors | 0 warnings | 0 note - diff --git a/inst/app-blorr/server.R b/inst/app-blorr/server.R index 05bed53..c15dce1 100644 --- a/inst/app-blorr/server.R +++ b/inst/app-blorr/server.R @@ -10,8 +10,6 @@ library(dplyr) library(e1071) library(ggplot2) library(glue) -library(grid) -library(gridExtra) library(jsonlite) library(lubridate) library(magrittr) diff --git a/inst/app-blorr/ui.R b/inst/app-blorr/ui.R index fb9eae0..79e32c9 100644 --- a/inst/app-blorr/ui.R +++ b/inst/app-blorr/ui.R @@ -1,6 +1,5 @@ library(shiny) library(shinyBS) -library(shinythemes) library(descriptr) library(dplyr) diff --git a/inst/app-blorr/ui/ui_dataoptions.R b/inst/app-blorr/ui/ui_dataoptions.R index afda42b..40efb75 100644 --- a/inst/app-blorr/ui/ui_dataoptions.R +++ b/inst/app-blorr/ui/ui_dataoptions.R @@ -1,6 +1,6 @@ tabPanel('Data Sources', value = 'tab_datasources', - fluidPage(theme = shinytheme('cerulean'), + fluidPage( includeCSS("mystyle.css"), @@ -47,4 +47,4 @@ tabPanel('Data Sources', value = 'tab_datasources', ) -) \ No newline at end of file +) diff --git a/inst/app-descriptr/logic/logic_freq_quant.R b/inst/app-descriptr/logic/logic_freq_quant.R index ef93f7a..95950d9 100644 --- a/inst/app-descriptr/logic/logic_freq_quant.R +++ b/inst/app-descriptr/logic/logic_freq_quant.R @@ -6,7 +6,7 @@ observeEvent(input$finalok, { numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, inputId = "var_freq_quant", - choices = names(numdata)) + choices = names(numdata), selected = names(numdata)[1]) updateSliderInput(session = session, inputId = 'filter_quant', min = min(numdata), @@ -22,7 +22,7 @@ observeEvent(input$finalok, { value = '') } else { updateSelectInput(session, 'var_freq_quant', - choices = names(num_data), selected = names(num_data)) + choices = names(num_data), selected = names(num_data)[1]) updateSliderInput(session = session, inputId = 'filter_quant', min = min(num_data), @@ -43,7 +43,7 @@ observeEvent(input$submit_part_train_per, { numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, inputId = "var_freq_quant", - choices = names(numdata)) + choices = names(numdata), selected = names(numdata)[1]) updateSliderInput(session = session, inputId = 'filter_quant', min = min(numdata), @@ -59,7 +59,7 @@ observeEvent(input$submit_part_train_per, { value = '') } else { updateSelectInput(session, 'var_freq_quant', - choices = names(num_data), selected = names(num_data)) + choices = names(num_data), selected = names(num_data)[1]) updateSliderInput(session = session, inputId = 'filter_quant', min = min(num_data), diff --git a/inst/app-descriptr/logic/logic_group_summary.R b/inst/app-descriptr/logic/logic_group_summary.R index 3b93ead..bdb8405 100644 --- a/inst/app-descriptr/logic/logic_group_summary.R +++ b/inst/app-descriptr/logic/logic_group_summary.R @@ -39,13 +39,13 @@ observeEvent(input$finalok, { numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, inputId = "var_grp_summary", - choices = names(numdata), selected = names(numdata)) + choices = names(numdata), selected = names(numdata)[1]) } else if (ncol(num_data) < 1) { updateSelectInput(session, inputId = "var_grp_summary", choices = '', selected = '') } else { updateSelectInput(session, inputId = "var_grp_summary", - choices = names(num_data), selected = names(num_data)) + choices = names(num_data), selected = names(num_data)[1]) } @@ -77,13 +77,13 @@ observeEvent(input$submit_part_train_per, { numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, inputId = "var_grp_summary", - choices = names(numdata), selected = names(numdata)) + choices = names(numdata), selected = names(numdata)[1]) } else if (ncol(num_data) < 1) { updateSelectInput(session, inputId = "var_grp_summary", choices = '', selected = '') } else { updateSelectInput(session, inputId = "var_grp_summary", - choices = names(num_data), selected = names(num_data)) + choices = names(num_data), selected = names(num_data)[1]) } diff --git a/inst/app-descriptr/logic/logic_mult1.R b/inst/app-descriptr/logic/logic_mult1.R index 9c3ca7b..6f3877c 100644 --- a/inst/app-descriptr/logic/logic_mult1.R +++ b/inst/app-descriptr/logic/logic_mult1.R @@ -6,6 +6,6 @@ output$mult1 <- renderPrint({ } else if (ncol(num_data) < 2) { out <- NULL } else { - ds_oway_tables(final_split$train) + ds_auto_freq_table(final_split$train) } }) diff --git a/inst/app-descriptr/logic/logic_mult2.R b/inst/app-descriptr/logic/logic_mult2.R index 0320df7..e5a43f6 100644 --- a/inst/app-descriptr/logic/logic_mult2.R +++ b/inst/app-descriptr/logic/logic_mult2.R @@ -6,7 +6,7 @@ output$mult2 <- renderPrint({ } else if (ncol(num_data) < 3) { out <- NULL } else { - ds_tway_tables(final_split$train) + ds_auto_cross_table(final_split$train) } }) diff --git a/inst/app-descriptr/logic/logic_summary.R b/inst/app-descriptr/logic/logic_summary.R index 17dacaf..8aeab07 100644 --- a/inst/app-descriptr/logic/logic_summary.R +++ b/inst/app-descriptr/logic/logic_summary.R @@ -6,7 +6,7 @@ observeEvent(input$finalok, { numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, inputId = "var_summary", - choices = names(numdata), selected = names(numdata)) + choices = names(numdata), selected = names(numdata)[1]) updateSliderInput(session = session, inputId = 'filter_summary', min = min(numdata), @@ -22,7 +22,7 @@ observeEvent(input$finalok, { value = '') } else { updateSelectInput(session, 'var_summary', - choices = names(num_data), selected = names(num_data)) + choices = names(num_data), selected = names(num_data)[1]) updateSliderInput(session = session, inputId = 'filter_summary', min = min(num_data), @@ -43,13 +43,13 @@ observeEvent(input$submit_part_train_per, { numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, inputId = "var_summary", - choices = names(numdata), selected = names(numdata)) + choices = names(numdata), selected = names(numdata)[1]) } else if (ncol(num_data) < 1) { updateSelectInput(session, inputId = "var_summary", choices = '', selected = '') } else { updateSelectInput(session, 'var_summary', - choices = names(num_data), selected = names(num_data)) + choices = names(num_data), selected = names(num_data)[1]) } }) diff --git a/inst/app-descriptr/logic/logic_view.R b/inst/app-descriptr/logic/logic_view.R index d65bacd..def46d6 100644 --- a/inst/app-descriptr/logic/logic_view.R +++ b/inst/app-descriptr/logic/logic_view.R @@ -1,4 +1,4 @@ -output$table <- renderDataTable({ +output$table <- renderDT({ final_split$train }) @@ -10,4 +10,4 @@ observeEvent(input$view2getdata, { observeEvent(input$view2analyze, { updateNavbarPage(session, 'mainpage', selected = 'tab_eda') updateNavlistPanel(session, 'navlist_eda', 'tab_summary') -}) \ No newline at end of file +}) diff --git a/inst/app-descriptr/server.R b/inst/app-descriptr/server.R index 80a964a..33895c4 100644 --- a/inst/app-descriptr/server.R +++ b/inst/app-descriptr/server.R @@ -13,6 +13,7 @@ library(stringr) library(rlang) library(ggplot2) library(forcats) +library(DT) shinyServer(function(input, output, session) { diff --git a/inst/app-descriptr/ui.R b/inst/app-descriptr/ui.R index d1f959e..fa9dc65 100644 --- a/inst/app-descriptr/ui.R +++ b/inst/app-descriptr/ui.R @@ -1,6 +1,6 @@ library(shiny) library(shinyBS) -library(shinythemes) +library(DT) shinyUI( diff --git a/inst/app-descriptr/ui/ui_dataoptions.R b/inst/app-descriptr/ui/ui_dataoptions.R index d4d072d..62e0c8a 100644 --- a/inst/app-descriptr/ui/ui_dataoptions.R +++ b/inst/app-descriptr/ui/ui_dataoptions.R @@ -1,6 +1,6 @@ tabPanel('Data Sources', value = 'tab_datasources', - fluidPage(theme = shinytheme('cerulean'), + fluidPage( includeCSS("mystyle.css"), @@ -48,4 +48,4 @@ tabPanel('Data Sources', value = 'tab_datasources', ) -) \ No newline at end of file +) diff --git a/inst/app-descriptr/ui/ui_view.R b/inst/app-descriptr/ui/ui_view.R index c830a98..4cbc08c 100644 --- a/inst/app-descriptr/ui/ui_view.R +++ b/inst/app-descriptr/ui/ui_view.R @@ -15,7 +15,7 @@ tabPanel('View', value = 'tab_view', hr(), fluidRow( - dataTableOutput(outputId = "table") + DTOutput(outputId = "table") ) ) ) diff --git a/inst/app-inferr/server.R b/inst/app-inferr/server.R index 885d2bb..f4db467 100644 --- a/inst/app-inferr/server.R +++ b/inst/app-inferr/server.R @@ -13,7 +13,6 @@ library(lubridate) library(scales) library(stringr) library(rlang) -library(xplorerr) shinyServer(function(input, output, session) { diff --git a/inst/app-inferr/ui.R b/inst/app-inferr/ui.R index 2005b35..3c94ff7 100644 --- a/inst/app-inferr/ui.R +++ b/inst/app-inferr/ui.R @@ -1,6 +1,5 @@ library(shiny) library(shinyBS) -library(shinythemes) library(descriptr) library(dplyr) diff --git a/inst/app-inferr/ui/ui_dataoptions.R b/inst/app-inferr/ui/ui_dataoptions.R index d4d072d..62e0c8a 100644 --- a/inst/app-inferr/ui/ui_dataoptions.R +++ b/inst/app-inferr/ui/ui_dataoptions.R @@ -1,6 +1,6 @@ tabPanel('Data Sources', value = 'tab_datasources', - fluidPage(theme = shinytheme('cerulean'), + fluidPage( includeCSS("mystyle.css"), @@ -48,4 +48,4 @@ tabPanel('Data Sources', value = 'tab_datasources', ) -) \ No newline at end of file +) diff --git a/inst/app-inferr/xpl-helpers.R b/inst/app-inferr/xpl-helpers.R index ae05cfa..552ed52 100644 --- a/inst/app-inferr/xpl-helpers.R +++ b/inst/app-inferr/xpl-helpers.R @@ -1282,7 +1282,6 @@ paired_comp <- function(x, y, confint, var_names) { corsig <- cor_sig(corr, n) alpha <- 1 - confint - confint1 <- conf_int_t(b[[1, 1]], b[[1, 2]], n, alpha = alpha) %>% round(2) confint2 <- conf_int_t(b[[2, 1]], b[[2, 2]], n, alpha = alpha) %>% round(2) confint3 <- conf_int_t(b[[3, 1]], b[[3, 2]], n, alpha = alpha) %>% round(2) @@ -1336,14 +1335,14 @@ cor_sig <- function(corr, n) { } conf_int_t <- function(u, s, n, alpha = 0.05) { - + a <- alpha / 2 df <- n - 1 error <- round(stats::qt(a, df), 3) * -1 lower <- u - (error * samp_err(s, n)) upper <- u + (error * samp_err(s, n)) c(lower, upper) - + } samp_err <- function(sigma, n) { @@ -1707,7 +1706,7 @@ tbl_stats <- function(data, y) { dat <- data[[y]] c(length(dat), mean(dat), sd(dat), (sd(dat) / sqrt(length(dat)))) - + } # binomial test diff --git a/inst/app-inferr/xpl-output.R b/inst/app-inferr/xpl-output.R index 909a895..02d7c7c 100644 --- a/inst/app-inferr/xpl-output.R +++ b/inst/app-inferr/xpl-output.R @@ -148,9 +148,9 @@ print_ttest <- function(data) { all_l <- paste("Ha: mean <", as.character(data$mu)) all_u <- paste("Ha: mean >", as.character(data$mu)) all_t <- paste("Ha: mean ~=", as.character(data$mu)) - char_p_l <- format(data$p_l, digits = 0, nsmall = 4) - char_p_u <- format(data$p_u, digits = 0, nsmall = 4) - char_p <- format(data$p, digits = 0, nsmall = 4) + char_p_l <- format(round(data$p_l, 5), nsmall = 5, scientific = FALSE) + char_p_u <- format(round(data$p_u, 5), nsmall = 5, scientific = FALSE) + char_p <- format(round(data$p, 5), nsmall = 5, scientific = FALSE) all_p_l <- paste("P < t =", char_p_l) all_p_t <- paste("P > |t| =", char_p) all_p_u <- paste("P > t =", char_p_u) @@ -286,10 +286,9 @@ print_ttest <- function(data) { print_paired_ttest <- function(data) { - char_p_u <- format(data$p_upper, digits = 0, nsmall = 3) - char_p_l <- format(data$p_lower, digits = 0, nsmall = 3) - char_p <- format(data$p_two_tail, digits = 0, nsmall = 3) - + char_p_u <- format(round(data$p_upper, 3), nsmall = 3, scientific = FALSE) + char_p_l <- format(round(data$p_lower, 3), nsmall = 3, scientific = FALSE) + char_p <- format(round(data$p_two_tail, 3), nsmall = 3, scientific = FALSE) # hypothesis heading hyp_null <- paste0("Ho: mean(", data$var_names[1], " - ", data$var_names[2], ") = ", "0") hyp_lt <- paste0("Ha: mean(", data$var_names[1], " - ", data$var_names[2], ") < ", "0") @@ -432,12 +431,13 @@ print_paired_ttest <- function(data) { print_two_ttest <- function(data) { - char_sig <- format(data$sig, digits = 0, nsmall = 4) - char_sig_l <- format(data$sig_l, digits = 0, nsmall = 4) - char_sig_u <- format(data$sig_u, digits = 0, nsmall = 4) - char_sig_pooled <- format(data$sig_pooled, digits = 0, nsmall = 4) - char_sig_pooled_l <- format(data$sig_pooled_l, digits = 0, nsmall = 4) - char_sig_pooled_u <- format(data$sig_pooled_u, digits = 0, nsmall = 4) + + char_sig <- format(round(data$sig, 4), nsmall = 4, scientific = FALSE) + char_sig_l <- format(round(data$sig_l, 4), nsmall = 4, scientific = FALSE) + char_sig_u <- format(round(data$sig_u, 4), nsmall = 4, scientific = FALSE) + char_sig_pooled <- format(round(data$sig_pooled, 4), nsmall = 4, scientific = FALSE) + char_sig_pooled_l <- format(round(data$sig_pooled_l, 4), nsmall = 4, scientific = FALSE) + char_sig_pooled_u <- format(round(data$sig_pooled_u, 4), nsmall = 4, scientific = FALSE) # hypothesis heading hyp_null <- paste0("Ho: mean(", data$levels[1], ") - mean(", data$levels[2], ") = diff = ", "0") @@ -737,9 +737,9 @@ print_os_vartest <- function(data) { all_l <- paste("Ha: sd <", as.character(data$sd)) all_u <- paste("Ha: sd >", as.character(data$sd)) all_t <- paste("Ha: sd !=", as.character(data$sd)) - char_p_l <- format(data$p_lower, digits = 0, nsmall = 4) - char_p_u <- format(data$p_upper, digits = 0, nsmall = 4) - char_p <- format(data$p_two, digits = 0, nsmall = 4) + char_p_l <- format(round(data$p_lower, 4), nsmall = 4, scientific = FALSE) + char_p_u <- format(round(data$p_upper, 4), nsmall = 4, scientific = FALSE) + char_p <- format(round(data$p_two, 4), nsmall = 4, scientific = FALSE) all_p_l <- paste("Pr(C < c) =", char_p_l) if (data$p_lower < 0.5) { all_p_t <- paste("2 * Pr(C < c) =", char_p) @@ -1185,8 +1185,8 @@ print_var_test <- function(data) { nhyp <- "Ho: ratio = 1" lhyp <- "Ha: ratio < 1" uhyp <- "Ha: ratio > 1" - char_p_l <- format(data$lower, digits = 0, nsmall = 4) - char_p_u <- format(data$upper, digits = 0, nsmall = 4) + char_p_l <- format(round(data$lower, 4), nsmall = 4, scientific = FALSE) + char_p_u <- format(round(data$upper, 4), nsmall = 4, scientific = FALSE) all_p_l <- paste("Pr(F < f) =", char_p_l) all_p_u <- paste("Pr(F > f) =", char_p_u) diff --git a/inst/app-olsrr/server.R b/inst/app-olsrr/server.R index 3726e06..59e5e28 100644 --- a/inst/app-olsrr/server.R +++ b/inst/app-olsrr/server.R @@ -3,8 +3,6 @@ library(ggplot2) library(descriptr) library(olsrr) library(dplyr) -library(grid) -library(gridExtra) library(purrr) library(tidyr) library(tibble) diff --git a/inst/app-olsrr/ui.R b/inst/app-olsrr/ui.R index 16c7bef..b6b96d1 100644 --- a/inst/app-olsrr/ui.R +++ b/inst/app-olsrr/ui.R @@ -1,6 +1,5 @@ library(shiny) library(shinyBS) -library(shinythemes) library(descriptr) library(dplyr) diff --git a/inst/app-olsrr/ui/ui_dataoptions.R b/inst/app-olsrr/ui/ui_dataoptions.R index afda42b..40efb75 100644 --- a/inst/app-olsrr/ui/ui_dataoptions.R +++ b/inst/app-olsrr/ui/ui_dataoptions.R @@ -1,6 +1,6 @@ tabPanel('Data Sources', value = 'tab_datasources', - fluidPage(theme = shinytheme('cerulean'), + fluidPage( includeCSS("mystyle.css"), @@ -47,4 +47,4 @@ tabPanel('Data Sources', value = 'tab_datasources', ) -) \ No newline at end of file +) diff --git a/inst/app-rfm/logic/logic_rfm_score.R b/inst/app-rfm/logic/logic_rfm_score.R index abf5cd4..b7281c4 100644 --- a/inst/app-rfm/logic/logic_rfm_score.R +++ b/inst/app-rfm/logic/logic_rfm_score.R @@ -126,15 +126,15 @@ observeEvent(input$submit_rfm_customer_score_2, { rfm_heatmap_generate <- reactiveValues(a = NULL) observeEvent(input$submit_rfm_transaction_score, { - rfm_heatmap_generate$a <- rfm_heatmap(rfm_final_score$a) + rfm_heatmap_generate$a <- rfm_plot_heatmap(rfm_final_score$a) }) observeEvent(input$submit_rfm_customer_score, { - rfm_heatmap_generate$a <- rfm_heatmap(rfm_final_score$a) + rfm_heatmap_generate$a <- rfm_plot_heatmap(rfm_final_score$a) }) observeEvent(input$submit_rfm_customer_score_2, { - rfm_heatmap_generate$a <- rfm_heatmap(rfm_final_score$a) + rfm_heatmap_generate$a <- rfm_plot_heatmap(rfm_final_score$a) }) output$plot_heatmap <- renderPlot({ @@ -144,15 +144,15 @@ output$plot_heatmap <- renderPlot({ rfm_barchart_generate <- reactiveValues(a = NULL) observeEvent(input$submit_rfm_transaction_score, { - rfm_barchart_generate$a <- rfm_bar_chart(rfm_final_score$a) + rfm_barchart_generate$a <- rfm_plot_bar_chart(rfm_final_score$a) }) observeEvent(input$submit_rfm_customer_score, { - rfm_barchart_generate$a <- rfm_bar_chart(rfm_final_score$a) + rfm_barchart_generate$a <- rfm_plot_bar_chart(rfm_final_score$a) }) observeEvent(input$submit_rfm_customer_score_2, { - rfm_barchart_generate$a <- rfm_bar_chart(rfm_final_score$a) + rfm_barchart_generate$a <- rfm_plot_bar_chart(rfm_final_score$a) }) output$plot_barchart <- renderPlot({ @@ -162,73 +162,17 @@ output$plot_barchart <- renderPlot({ rfm_histogram_generate <- reactiveValues(a = NULL) observeEvent(input$submit_rfm_transaction_score, { - rfm_histogram_generate$a <- rfm_histograms(rfm_final_score$a) + rfm_histogram_generate$a <- rfm_plot_histogram(rfm_final_score$a) }) observeEvent(input$submit_rfm_customer_score, { - rfm_histogram_generate$a <- rfm_histograms(rfm_final_score$a) + rfm_histogram_generate$a <- rfm_plot_histogram(rfm_final_score$a) }) observeEvent(input$submit_rfm_customer_score_2, { - rfm_histogram_generate$a <- rfm_histograms(rfm_final_score$a) + rfm_histogram_generate$a <- rfm_plot_histogram(rfm_final_score$a) }) output$plot_histogram <- renderPlot({ print(rfm_histogram_generate$a) -}) - -rfm_scatter_1_generate <- reactiveValues(a = NULL) - -observeEvent(input$submit_rfm_transaction_score, { - rfm_scatter_1_generate$a <- rfm_rm_plot(rfm_final_score$a) -}) - -observeEvent(input$submit_rfm_customer_score, { - rfm_scatter_1_generate$a <- rfm_rm_plot(rfm_final_score$a) -}) - -observeEvent(input$submit_rfm_customer_score_2, { - rfm_scatter_1_generate$a <- rfm_rm_plot(rfm_final_score$a) -}) - -output$plot_scatter_1 <- renderPlot({ - print(rfm_scatter_1_generate$a) -}) - -rfm_scatter_2_generate <- reactiveValues(a = NULL) - -observeEvent(input$submit_rfm_transaction_score, { - rfm_scatter_2_generate$a <- rfm_fm_plot(rfm_final_score$a) -}) - -observeEvent(input$submit_rfm_customer_score, { - rfm_scatter_2_generate$a <- rfm_fm_plot(rfm_final_score$a) -}) - -observeEvent(input$submit_rfm_customer_score_2, { - rfm_scatter_2_generate$a <- rfm_fm_plot(rfm_final_score$a) -}) - -output$plot_scatter_2 <- renderPlot({ - print(rfm_scatter_2_generate$a) -}) - -rfm_scatter_3_generate <- reactiveValues(a = NULL) - -observeEvent(input$submit_rfm_transaction_score, { - rfm_scatter_3_generate$a <- rfm_rf_plot(rfm_final_score$a) -}) - -observeEvent(input$submit_rfm_customer_score, { - rfm_scatter_3_generate$a <- rfm_rf_plot(rfm_final_score$a) -}) - -observeEvent(input$submit_rfm_customer_score_2, { - rfm_scatter_3_generate$a <- rfm_rf_plot(rfm_final_score$a) -}) - -output$plot_scatter_3 <- renderPlot({ - print(rfm_scatter_3_generate$a) -}) - - +}) \ No newline at end of file diff --git a/inst/app-rfm/logic/logic_segments.R b/inst/app-rfm/logic/logic_segments.R index 51e7d3f..c98177c 100644 --- a/inst/app-rfm/logic/logic_segments.R +++ b/inst/app-rfm/logic/logic_segments.R @@ -131,9 +131,11 @@ prep_segment <- eventReactive(input$button_create_segments, { use_series(rfm) for (i in seq_len(input$n_segments)) { - rfm_score_table$segment[((rfm_score_table$recency_score %>% between(recency_lower()[i], recency_upper()[i])) & + rfm_score_table$segment[( + (rfm_score_table$recency_score %>% between(recency_lower()[i], recency_upper()[i])) & (rfm_score_table$frequency_score %>% between(frequency_lower()[i], frequency_upper()[i])) & - (rfm_score_table$monetary_score %>% between(monetary_lower()[i], monetary_upper()[i])))] <- segment_names()[i] + (rfm_score_table$monetary_score %>% between(monetary_lower()[i], monetary_upper()[i])) & + !rfm_score_table$segment %in% segment_names)] <- segment_names()[i] } rfm_score_table$segment[is.na(rfm_score_table$segment)] <- "Others" diff --git a/inst/app-rfm/server.R b/inst/app-rfm/server.R index b6c5b23..c0a7db8 100644 --- a/inst/app-rfm/server.R +++ b/inst/app-rfm/server.R @@ -17,7 +17,7 @@ library(forcats) library(purrr) library(RColorBrewer) library(knitr) -library(kableExtra) + shinyServer(function(input, output, session) { diff --git a/inst/app-rfm/ui.R b/inst/app-rfm/ui.R index 7b7dad9..5aca256 100644 --- a/inst/app-rfm/ui.R +++ b/inst/app-rfm/ui.R @@ -1,9 +1,8 @@ library(shiny) library(shinyBS) -library(shinythemes) library(shinycssloaders) library(magrittr) -library(shinycssloaders) +library(standby) shinyUI( diff --git a/inst/app-rfm/ui/ui_dataoptions.R b/inst/app-rfm/ui/ui_dataoptions.R index d4d072d..62e0c8a 100644 --- a/inst/app-rfm/ui/ui_dataoptions.R +++ b/inst/app-rfm/ui/ui_dataoptions.R @@ -1,6 +1,6 @@ tabPanel('Data Sources', value = 'tab_datasources', - fluidPage(theme = shinytheme('cerulean'), + fluidPage( includeCSS("mystyle.css"), @@ -48,4 +48,4 @@ tabPanel('Data Sources', value = 'tab_datasources', ) -) \ No newline at end of file +) diff --git a/inst/app-rfm/ui/ui_rfm.R b/inst/app-rfm/ui/ui_rfm.R index 418367d..e96531d 100644 --- a/inst/app-rfm/ui/ui_rfm.R +++ b/inst/app-rfm/ui/ui_rfm.R @@ -9,8 +9,7 @@ tabPanel('RFM', value = 'tab_rfm', icon = icon('sitemap'), source('ui/ui_rfm_customer_2.R', local = TRUE)[[1]], source('ui/ui_rfm_heat_map.R', local = TRUE)[[1]], source('ui/ui_rfm_bar_chart.R', local = TRUE)[[1]], - source('ui/ui_rfm_histogram.R', local = TRUE)[[1]], - source('ui/ui_rfm_scatter_plot.R', local = TRUE)[[1]] + source('ui/ui_rfm_histogram.R', local = TRUE)[[1]] ) ) \ No newline at end of file diff --git a/inst/app-rfm/ui/ui_rfm_bar_chart.R b/inst/app-rfm/ui/ui_rfm_bar_chart.R index 6e42fb8..5bc7f33 100644 --- a/inst/app-rfm/ui/ui_rfm_bar_chart.R +++ b/inst/app-rfm/ui/ui_rfm_bar_chart.R @@ -18,8 +18,7 @@ tabPanel('Bar Chart', value = 'tab_rfm_barchart', br(), column(2), column(8, align = 'center', - plotOutput('plot_barchart', height = '500px') %>% - withSpinner() + plotOutput('plot_barchart', height = '500px') ), column(2) diff --git a/inst/app-rfm/ui/ui_rfm_heat_map.R b/inst/app-rfm/ui/ui_rfm_heat_map.R index f9eaa40..7f93dc8 100644 --- a/inst/app-rfm/ui/ui_rfm_heat_map.R +++ b/inst/app-rfm/ui/ui_rfm_heat_map.R @@ -20,8 +20,7 @@ tabPanel('Heat Map', value = 'tab_rfm_heatmap', br(), column(2), column(8, align = 'center', - plotOutput('plot_heatmap', height = '500px') %>% - withSpinner() + plotOutput('plot_heatmap', height = '500px') ), column(2) diff --git a/inst/app-rfm/ui/ui_rfm_histogram.R b/inst/app-rfm/ui/ui_rfm_histogram.R index 2575474..03cf6fa 100644 --- a/inst/app-rfm/ui/ui_rfm_histogram.R +++ b/inst/app-rfm/ui/ui_rfm_histogram.R @@ -16,9 +16,8 @@ tabPanel('Histogram', value = 'tab_rfm_histogram', br(), br(), column(2), - column(8, align = 'center', - plotOutput('plot_histogram', height = '500px') %>% - withSpinner() + column(8, align = 'center', + plotOutput('plot_histogram', height = '500px') ), column(2) diff --git a/inst/app-rfm/ui/ui_rfm_scatter_plot.R b/inst/app-rfm/ui/ui_rfm_scatter_plot.R index c601f89..4c6f49a 100644 --- a/inst/app-rfm/ui/ui_rfm_scatter_plot.R +++ b/inst/app-rfm/ui/ui_rfm_scatter_plot.R @@ -17,8 +17,7 @@ tabPanel('Scatter Plots', value = 'tab_rfm_scatter', br(), column(2), column(8, align = 'center', - plotOutput('plot_scatter_1', height = '500px') %>% - withSpinner() + plotOutput('plot_scatter_1', height = '500px') ), column(2) @@ -30,8 +29,7 @@ tabPanel('Scatter Plots', value = 'tab_rfm_scatter', br(), column(2), column(8, align = 'center', - plotOutput('plot_scatter_2', height = '500px') %>% - withSpinner() + plotOutput('plot_scatter_2', height = '500px') ), column(2) @@ -43,8 +41,7 @@ tabPanel('Scatter Plots', value = 'tab_rfm_scatter', br(), column(2), column(8, align = 'center', - plotOutput('plot_scatter_3', height = '500px') %>% - withSpinner() + plotOutput('plot_scatter_3', height = '500px') ), column(2) ) diff --git a/inst/app-rfm/ui/ui_rfm_score_transaction.R b/inst/app-rfm/ui/ui_rfm_score_transaction.R index 6ed6150..4fcecf9 100644 --- a/inst/app-rfm/ui/ui_rfm_score_transaction.R +++ b/inst/app-rfm/ui/ui_rfm_score_transaction.R @@ -130,8 +130,7 @@ tabPanel('Transaction Data', value = 'tab_rfm_transaction_score', fluidRow( br(), - dataTableOutput('rfm_transaction_score_out') %>% - withSpinner() + dataTableOutput('rfm_transaction_score_out') ) ) diff --git a/inst/app-rfm/ui/ui_segment_size.R b/inst/app-rfm/ui/ui_segment_size.R index 26904cb..6813bdb 100644 --- a/inst/app-rfm/ui/ui_segment_size.R +++ b/inst/app-rfm/ui/ui_segment_size.R @@ -16,8 +16,7 @@ tabPanel("Segment Size", value = "tab_segment_size", br(), br(), column(12, align = 'center', - verbatimTextOutput('segment_size_out') %>% - withSpinner() + verbatimTextOutput('segment_size_out') ) ) diff --git a/inst/app-rfm/ui/ui_segments.R b/inst/app-rfm/ui/ui_segments.R index 31f155c..07b8ea2 100644 --- a/inst/app-rfm/ui/ui_segments.R +++ b/inst/app-rfm/ui/ui_segments.R @@ -44,9 +44,7 @@ tabPanel("Segmentation", value = "tab_rfm_segments", column(12, align = 'center', br(), - actionButton(inputId="button_create_segments", label="Generate Segments", icon = icon('thumbs-up')), - bsTooltip("button_create_segments", "Click here to generate segments.", - "top", options = list(container = "body")), + actionButton(inputId = "button_create_segments", label = "Generate Segments", icon = icon('thumbs-up')), br(), br() ) diff --git a/inst/app-vistributions/ui.R b/inst/app-vistributions/ui.R index 54b201b..14802e2 100644 --- a/inst/app-vistributions/ui.R +++ b/inst/app-vistributions/ui.R @@ -1,6 +1,5 @@ library(shiny) library(shinyBS) -library(shinythemes) library(magrittr) shinyUI( diff --git a/inst/app-vistributions/ui/ui_dist_home.R b/inst/app-vistributions/ui/ui_dist_home.R index a7b74bc..5198f00 100644 --- a/inst/app-vistributions/ui/ui_dist_home.R +++ b/inst/app-vistributions/ui/ui_dist_home.R @@ -1,6 +1,6 @@ tabPanel('Distributions', value = 'tab_dist_home', - fluidPage(theme = shinytheme('cerulean'), + fluidPage( includeCSS("mystyle.css"), @@ -117,4 +117,4 @@ tabPanel('Distributions', value = 'tab_dist_home', ) ) -) \ No newline at end of file +) diff --git a/inst/app-visualize/helper/barly2.R b/inst/app-visualize/helper/barly2.R index b68c032..7ff845b 100644 --- a/inst/app-visualize/helper/barly2.R +++ b/inst/app-visualize/helper/barly2.R @@ -199,6 +199,4 @@ barly2 <- function(x, y, data, auto_size = TRUE, } -# test -barly2('cyl', 'gear', mtcars) diff --git a/inst/app-visualize/helper/bbox-plot.R b/inst/app-visualize/helper/bbox-plot.R index cd1d97a..2e589d8 100644 --- a/inst/app-visualize/helper/bbox-plot.R +++ b/inst/app-visualize/helper/bbox-plot.R @@ -19,20 +19,6 @@ box_plotb <- function(x, y, color = 'blue', borders = 'black', title = NA, subs cex.lab = cexlab) - # # legend - # if (leg == TRUE) { - # legend(leg_x, leg_y, - # legend = legend, pch = leg_point, col = leg_colour, - # bty = leg_boxtype, bg = leg_boxcol, - # box.lty = leg_boxlty, box.lwd = leg_boxlwd, - # box.col = leg_boxborcol, xjust = leg_boxxjust, - # yjust = leg_boxyjust, text.col = leg_textcol, - # text.font = leg_textfont, ncol = leg_textcolumns, - # horiz = leg_texthoriz, title = leg_title, - # title.col = leg_titlecol, title.adj = leg_textadj) - # } - - # add text inside the plot text(text_x_loc, text_y_loc, text_p, font = text_font, col = text_col, cex = text_size) @@ -43,8 +29,3 @@ box_plotb <- function(x, y, color = 'blue', borders = 'black', title = NA, subs } - -# leg = FALSE, leg_x, leg_y, legend, -# leg_point = 15, leg_colour, leg_boxtype, leg_boxcol, leg_boxlty, leg_boxlwd, -# leg_boxborcol, leg_boxxjust, leg_boxyjust, leg_textcol, leg_textfont, -# leg_textcolumns, leg_texthoriz, leg_title, leg_titlecol, leg_textadj, \ No newline at end of file diff --git a/inst/app-visualize/helper/bobar.R b/inst/app-visualize/helper/bobar.R deleted file mode 100644 index 38863b4..0000000 --- a/inst/app-visualize/helper/bobar.R +++ /dev/null @@ -1,25 +0,0 @@ -bobar <- function(x_data = NULL, data = NULL, fig_title = NULL, - x_lab = NULL, y_lab = NULL, x_grid = TRUE, - y_grid = TRUE, bar_width = 0.9, bar_hover = TRUE, - bar_col = NULL, bar_f_alpha = 1, - bar_l_col = NULL, bar_l_alpha = 1) { - - xdata <- data %>% - select_(x_data) %>% - table() %>% - as.vector() - - xlev <- data %>% - select_(x_data) %>% - unlist() %>% - levels() - - ba <- figure(title = fig_title, xlab = x_lab, ylab = y_lab, - xgrid = x_grid, ygrid = y_grid, legend_location = NULL) %>% - ly_bar(x = xlev, y = xdata, hover = bar_hover, - width = bar_width, fill_color = bar_col, fill_alpha = bar_f_alpha, - line_color = bar_l_col, line_alpha = bar_l_alpha) - - ba - -} \ No newline at end of file diff --git a/inst/app-visualize/helper/bobar2.R b/inst/app-visualize/helper/bobar2.R deleted file mode 100644 index 79546df..0000000 --- a/inst/app-visualize/helper/bobar2.R +++ /dev/null @@ -1,13 +0,0 @@ -bobar2 <- function(data = NULL, var_1 = NULL, var_2 = NULL, fig_title = NULL, - x_lab = NULL, y_lab = NULL, x_grid = TRUE, y_grid = TRUE, - legend_loc = 'top_right', bar_pos = 'dodge', - bar_hover = TRUE, bar_width = 0.9, bar_f_alpha = 1) { - - ba <- figure(title = fig_title, xlab = x_lab, ylab = y_lab, - xgrid = x_grid, ygrid = y_grid, legend_location = legend_loc) %>% - ly_bar(data = mtcars, x = var_1, y = rep(1, length(var_1)), position = bar_pos, - color = var_2, hover = bar_hover, width = bar_width, fill_alpha = bar_f_alpha) - - ba - -} \ No newline at end of file diff --git a/inst/app-visualize/helper/bobox.R b/inst/app-visualize/helper/bobox.R deleted file mode 100644 index ebebf11..0000000 --- a/inst/app-visualize/helper/bobox.R +++ /dev/null @@ -1,14 +0,0 @@ -bobox <- function(x_data = NULL, data = NULL, fig_title = NULL, x_lab = NULL, - y_lab = NULL, x_grid = TRUE, y_grid = TRUE, legend_loc = NULL, - box_w = 0.9, box_col = NULL, box_alp = 1, box_l_col = NULL, - box_out_gly = 1, box_out_size = 10) { - - p <- figure(title = fig_title, xlab = x_lab, ylab = y_lab, xgrid = x_grid, - ygrid = y_grid, legend_location = legend_loc) %>% - ly_boxplot(x = x_data, data = data, width = box_w, fill_color = box_col, - fill_alpha = box_alp, line_color = box_l_col, - outlier_glyph = box_out_gly, outlier_size = box_out_size) - - p - -} \ No newline at end of file diff --git a/inst/app-visualize/helper/bobox2.R b/inst/app-visualize/helper/bobox2.R deleted file mode 100644 index 78c314d..0000000 --- a/inst/app-visualize/helper/bobox2.R +++ /dev/null @@ -1,14 +0,0 @@ -bobox2 <- function(data = NULL, x_data = NULL, y_data = NULL, fig_title = NULL, - x_lab = NULL, y_lab = NULL, x_grid = TRUE, y_grid = TRUE, - legend_loc = 'top_right', box_w = 0.9, - box_alp = 1, box_out_gly = 1, box_out_size = 10) { - - p <- figure(title = fig_title, xlab = x_lab, ylab = y_lab, xgrid = x_grid, - ygrid = y_grid, legend_location = legend_loc) %>% - ly_boxplot(data = data, x = x_data, y = y_data, width = box_w, - fill_alpha = box_alp, outlier_glyph = box_out_gly, - outlier_size = box_out_size) - - p - -} diff --git a/inst/app-visualize/helper/bohist.R b/inst/app-visualize/helper/bohist.R deleted file mode 100644 index ea9eacd..0000000 --- a/inst/app-visualize/helper/bohist.R +++ /dev/null @@ -1,22 +0,0 @@ -bohist <- function(data = NULL, x_data = NULL, fig_title = NULL, x_lab = NULL, y_lab = NULL, - h_breaks = 5, h_freq = TRUE, h_incl_low = TRUE, - h_right = TRUE, h_fill_col = 'blue', add_density = FALSE, - den_col = 'black', den_alpha = 1, den_width = 1, - den_type = 1, den_leg = FALSE) { - - xdata <- data %>% - select_(x_data) %>% - unlist() - - h <- figure(title = fig_title, xlab = x_lab, ylab = y_lab, legend_location = NULL) %>% - ly_hist(x = xdata, data = data, breaks = h_breaks, freq = h_freq, - include.lowest = h_incl_low, right = h_right, fill_color = h_fill_col) - - if(add_density) { - h <- ly_density(x = xdata, data = data, color = den_col, alpha = den_alpha, - width = den_width, type = den_type, legend = den_leg) - } - - h -} - diff --git a/inst/app-visualize/helper/boline.R b/inst/app-visualize/helper/boline.R deleted file mode 100644 index c4244e4..0000000 --- a/inst/app-visualize/helper/boline.R +++ /dev/null @@ -1,14 +0,0 @@ -boline <- function(data = data, x_data = NULL, y_data = NULL, fig_title = NULL, - x_lab = NULL, y_lab = NULL, l_color = NULL, l_type = 1, l_width = 1, - l_alpha = 1) { - - suppressWarnings( - p <- figure(title = fig_title, xlab = x_lab, ylab = y_lab, legend_location = NULL) %>% - ly_lines(x = x_data, y = y_data, data = data, - color = l_color, type = l_type, width = l_width, - alpha = l_alpha, legend = FALSE) - ) - - p - -} \ No newline at end of file diff --git a/inst/app-visualize/helper/boscatter.R b/inst/app-visualize/helper/boscatter.R deleted file mode 100644 index 5889fa3..0000000 --- a/inst/app-visualize/helper/boscatter.R +++ /dev/null @@ -1,31 +0,0 @@ -bokatter <- function(data = NULL, x_data = NULL, y_data = NULL, fig_title = NULL, - x_lab = NULL, y_lab = NULL, x_grid = TRUE, y_grid = TRUE, - glyph = 21, point_size = 10, inner_col = 'blue', inner_alpha = 1, - add_line = FALSE, line_a = NULL, line_b = NULL, - line_color = 'black', line_alpha = NULL, line_width = 1, - line_type = 1) { - - suppressWarnings( - p <- figure(title = fig_title, xlab = x_lab, ylab = y_lab, - xgrid = x_grid, ygrid = y_grid) %>% - ly_points(x = x_data, y = y_data, data = data, glyph = glyph, - size = point_size, fill_color = inner_col, - fill_alpha = inner_alpha, hover = list(x_data, y_data)) - ) - - - suppressWarnings( - if(add_line) { - suppressWarnings( - p <- p %>% - ly_abline(a = line_a, b = line_b, color = line_color, width = line_width, - alpha = line_alpha, type = line_type, legend = NULL) - ) - - } - ) - - p - -} - diff --git a/inst/app-visualize/helper/boxly1.R b/inst/app-visualize/helper/boxly1.R index 5a7d349..0ddd676 100644 --- a/inst/app-visualize/helper/boxly1.R +++ b/inst/app-visualize/helper/boxly1.R @@ -189,11 +189,3 @@ boxly1 <- function(data = NULL, y = NULL, b_points = "outliers", } -# p <- boxly1(mtcars, 'mpg', outliers = "suspectedoutliers") -# p -# -y3 <- c(0.75, 5.25, 5.5, 6, 6.2, 6.6, 6.80, 7.0, 7.2, 7.5, 7.5, 7.75, 8.15, - 8.15, 8.65, 8.93, 9.2, 9.5, 10, 10.25, 11.5, 12, 16, 20.90, 22.3, 23.25) - -p <- boxly1(y = y3, b_points = "suspectedoutliers") -p diff --git a/inst/app-visualize/helper/boxly2.R b/inst/app-visualize/helper/boxly2.R index 4791a69..a12fdad 100644 --- a/inst/app-visualize/helper/boxly2.R +++ b/inst/app-visualize/helper/boxly2.R @@ -186,7 +186,3 @@ boxly2 <- function(data = NULL, y = NULL, b_points = "outliers", } -mtcars$cyl <- as.factor(mtcars$cyl) -p <- boxly2(mtcars, y = 'mpg', x = 'cyl') -p - diff --git a/inst/app-visualize/helper/ggbibar.R b/inst/app-visualize/helper/ggbibar.R index d835ec1..73ef957 100644 --- a/inst/app-visualize/helper/ggbibar.R +++ b/inst/app-visualize/helper/ggbibar.R @@ -22,8 +22,8 @@ ggbibar <- function(data, x, y, stacked = TRUE, horizontal = FALSE, posit <- 'dodge' } - p <- ggplot(data, aes_string(x)) + - geom_bar(aes_string(fill = y), position = posit) + p <- ggplot(data, aes(.data[[x]])) + + geom_bar(aes(fill = .data[[y]]), position = posit) if (horizontal) { p <- p + coord_flip() @@ -86,4 +86,3 @@ ggbibar <- function(data, x, y, stacked = TRUE, horizontal = FALSE, } -ggbibar(mtcars, 'cyl', 'gear', horizontal = TRUE, stacked = FALSE) diff --git a/inst/app-visualize/helper/ggbox1.R b/inst/app-visualize/helper/ggbox1.R index b8c114a..8e468f0 100644 --- a/inst/app-visualize/helper/ggbox1.R +++ b/inst/app-visualize/helper/ggbox1.R @@ -20,7 +20,7 @@ ggbox1 <- function(data, y, notch = FALSE, fill = 'blue', col = 'black', add_text = FALSE, xloc = NA, yloc = NA, label = NA, tex_color = NA, tex_size = NA) { - p <- ggplot(data, aes_string(x = factor(1), y = y)) + + p <- ggplot(data, aes(x = factor(1), y = .data[[y]])) + geom_boxplot(notch = notch, fill = fill, color = col, outlier.color = o_col, outlier.fill = o_fill, outlier.shape = o_shape, outlier.alpha = o_alpha, diff --git a/inst/app-visualize/helper/ggbox2.R b/inst/app-visualize/helper/ggbox2.R index e1fe409..5a351f4 100644 --- a/inst/app-visualize/helper/ggbox2.R +++ b/inst/app-visualize/helper/ggbox2.R @@ -20,7 +20,7 @@ ggbox2 <- function(data, x, y, notch = FALSE, fill = 'blue', col = 'black', add_text = FALSE, xloc = NA, yloc = NA, label = NA, tex_color = NA, tex_size = NA) { - p <- ggplot(data, aes_string(x = x, y = y)) + + p <- ggplot(data, aes(x = .data[[x]], y = .data[[y]])) + geom_boxplot(notch = notch, fill = fill, color = col, outlier.color = o_col, outlier.fill = o_fill, outlier.shape = o_shape, outlier.alpha = o_alpha, diff --git a/inst/app-visualize/helper/gghist.R b/inst/app-visualize/helper/gghist.R index c8f8e3b..97be126 100644 --- a/inst/app-visualize/helper/gghist.R +++ b/inst/app-visualize/helper/gghist.R @@ -16,7 +16,7 @@ gghist <- function(data, x, bins = 5, fill = 'blue', col = 'black', add_text = FALSE, xloc = NA, yloc = NA, label = NA, tex_color = NA, tex_size = NA) { - p <- ggplot(data, aes_string(x)) + + p <- ggplot(data, aes(.data[[x]])) + geom_histogram(bins = bins, fill = fill, color = col) if (yaxlimit) { @@ -78,4 +78,3 @@ gghist <- function(data, x, bins = 5, fill = 'blue', col = 'black', } -gghist(mtcars, 'mpg') diff --git a/inst/app-visualize/helper/ggline.R b/inst/app-visualize/helper/ggline.R index 9ac1b32..5da36c4 100644 --- a/inst/app-visualize/helper/ggline.R +++ b/inst/app-visualize/helper/ggline.R @@ -1,10 +1,3 @@ -# gdp <- readr::read_csv('J:/R/ggplot_xplorerr/gdp.csv') -# p <- ggplot(gdp) + -# geom_line(aes(x = year, y = india), col = 'blue') + -# geom_line(aes(x = year, y = china), col = 'red') -# p - - ggline <- function(data, x, columns, cols = 'black', theme = "Default", alphas = 1, ltypes = 1, sizes = 1, yaxlimit = FALSE, y1 = NA, y2 = NA, @@ -25,11 +18,11 @@ ggline <- function(data, x, columns, cols = 'black', theme = "Default", label = NA, tex_color = NA, tex_size = NA) { x <- data %>% - select(x) %>% + select(all_of(x)) %>% pull(1) column <- data %>% - select(columns) + select(all_of(columns)) j <- column %>% ncol() @@ -57,9 +50,9 @@ ggline <- function(data, x, columns, cols = 'black', theme = "Default", for (i in n) { p <- p + - geom_line(aes_string(x = x, y = column[[i]]), + geom_line(aes(x = x, y = column[[i]]), color = cols[[i]], alpha = alphas[[i]], - linetype = ltypes[[i]], size = sizes[[i]]) + linetype = ltypes[[i]], linewidth = sizes[[i]]) } if (yaxlimit) { @@ -121,4 +114,3 @@ ggline <- function(data, x, columns, cols = 'black', theme = "Default", } -# ggline(gdp, 'year', c('india', 'china')) diff --git a/inst/app-visualize/helper/ggline2.R b/inst/app-visualize/helper/ggline2.R index fe2c90b..6966ea3 100644 --- a/inst/app-visualize/helper/ggline2.R +++ b/inst/app-visualize/helper/ggline2.R @@ -17,22 +17,12 @@ ggline2 <- function(data, x, columns, groups, cols = NULL, add_text = FALSE, xloc = NA, yloc = NA, label = NA, tex_color = NA, tex_size = NA) { - # x <- data %>% - # select(x) %>% - # pull(1) - # - # column <- data %>% - # select(columns) - # - # groupvar <- data %>% - # select(groups) - p <- ggplot(data) p <- p + - geom_line(aes_string(x = x, y = columns, group = groups, + geom_line(aes(x = .data[[x]], y = .data[[columns]], group = .data[[groups]], color = cols, linetype = ltypes, - size = sizes)) + linewidth = sizes)) if (yaxlimit) { diff --git a/inst/app-visualize/helper/ggscatter.R b/inst/app-visualize/helper/ggscatter.R index 74dcf02..69b23e9 100644 --- a/inst/app-visualize/helper/ggscatter.R +++ b/inst/app-visualize/helper/ggscatter.R @@ -23,7 +23,7 @@ gscatter <- function(data, x, y, aes_var = FALSE, reg_line = FALSE, if(aes_var) { if(is.numeric(shape)) { - p <- ggplot(data = data, mapping = aes_string(x = x, y = y, + p <- ggplot(data = data, mapping = aes(x = .data[[x]], y = .data[[y]], colour = color, shape = color, size = size)) + geom_point() } else { @@ -107,16 +107,3 @@ gscatter <- function(data, x, y, aes_var = FALSE, reg_line = FALSE, p } - - -# test -# mtcars$cyl <- as.factor(mtcars$cyl) -# mtcars$gear <- as.factor(mtcars$gear) -# mtcars$am <- as.factor(mtcars$am) - -# gscatter(mtcars, 'disp', 'mpg', aes_var = TRUE, -# color = 'cyl') - -# k <- gscatter(mtcars, 'disp', 'mpg', aes_var = FALSE, -# color = 'red', shape = 22, size = 3, fill = 'blue', -# reg_line = TRUE, reg_method = 'loess', reg_se = FALSE) diff --git a/inst/app-visualize/helper/ggunibar.R b/inst/app-visualize/helper/ggunibar.R index ceb18ff..260e514 100644 --- a/inst/app-visualize/helper/ggunibar.R +++ b/inst/app-visualize/helper/ggunibar.R @@ -1,8 +1,5 @@ library(ggplot2) -# mtcars$cyl <- as.factor(mtcars$cyl) -# mtcars$gear <- as.factor(mtcars$gear) - ggbar1 <- function(data, column, bar_col = 'blue', bor_col = 'black', theme = "Default", yaxlimit = FALSE, y1 = NA, y2 = NA, horizontal = FALSE, title = NULL, xlab = NULL, ylab = NULL, sub = NULL, @@ -21,7 +18,7 @@ ggbar1 <- function(data, column, bar_col = 'blue', bor_col = 'black', theme = "D add_text = FALSE, xloc = NA, yloc = NA, label = NA, tex_color = NA, tex_size = NA) { - p <- ggplot(data, aes_string(column)) + + p <- ggplot(data, aes(.data[[column]])) + geom_bar(fill = bar_col, col = bor_col) if (yaxlimit) { @@ -88,4 +85,3 @@ ggbar1 <- function(data, column, bar_col = 'blue', bor_col = 'black', theme = "D } -ggbar1(mtcars, 'cyl', yaxlimit = TRUE, y1 = 0, y2 = 20, horizontal = TRUE) diff --git a/inst/app-visualize/helper/hibox2.R b/inst/app-visualize/helper/hibox2.R index b6ee6a4..536edae 100644 --- a/inst/app-visualize/helper/hibox2.R +++ b/inst/app-visualize/helper/hibox2.R @@ -50,5 +50,3 @@ highbox <- function(data, y, x, col = 'blue', } -mtcars$gear <- as.factor(mtcars$gear) -highbox(mtcars, 'disp', 'gear') diff --git a/inst/app-visualize/helper/highhist.R b/inst/app-visualize/helper/highhist.R index 0ce86fe..2a9a55f 100644 --- a/inst/app-visualize/helper/highhist.R +++ b/inst/app-visualize/helper/highhist.R @@ -4,12 +4,11 @@ highist <- function(data, column, xlab = ' ', color = 'blue') { select_(column) %>% pull(1) - h <- hchist(da, name = xlab) - h %>% + da %>% + hchart(name = xlab) %>% hc_colors(colors = color) %>% hc_yAxis(title = list(text = 'Frequency')) } -highist(mtcars, 'mpg', xlab = 'Miles Per Gallon', color = 'red') diff --git a/inst/app-visualize/helper/highline.R b/inst/app-visualize/helper/highline.R index 1e1993e..3cfb6f3 100644 --- a/inst/app-visualize/helper/highline.R +++ b/inst/app-visualize/helper/highline.R @@ -1,12 +1,4 @@ library(highcharter) -# title -# subtitile -# axis -# legend -# plotoptions - - -# gdp <- readr::read_csv('gdp.csv') highline <- function(data, x, columns, add_labels = FALSE) { @@ -38,5 +30,4 @@ highline <- function(data, x, columns, add_labels = FALSE) { } -# highline(gdp, 'year', c('india', 'china'), add_labels = TRUE) diff --git a/inst/app-visualize/helper/highpie.R b/inst/app-visualize/helper/highpie.R index 7131c08..a481c55 100644 --- a/inst/app-visualize/helper/highpie.R +++ b/inst/app-visualize/helper/highpie.R @@ -20,4 +20,3 @@ highpie <- function(data, column) { } -# highpie(mtcars, 'cyl') diff --git a/inst/app-visualize/helper/histly.R b/inst/app-visualize/helper/histly.R index 817394f..510dda9 100644 --- a/inst/app-visualize/helper/histly.R +++ b/inst/app-visualize/helper/histly.R @@ -208,5 +208,3 @@ histly <- function(data = NULL, y = NULL, hist_orient = 'v', } -h <- histly(mtcars, 'mpg', hist_orient = "h") -h diff --git a/inst/app-visualize/helper/histogram.R b/inst/app-visualize/helper/histogram.R index bd8c431..757dcb6 100644 --- a/inst/app-visualize/helper/histogram.R +++ b/inst/app-visualize/helper/histogram.R @@ -45,7 +45,3 @@ hist_plot <- function(x, bins, title = NA, xlab = NA, } -# histogram test -# hist_plot(mtcars$disp, bins = 5, colours = "blue", border = "red") - - diff --git a/inst/app-visualize/helper/linely.R b/inst/app-visualize/helper/linely.R index c4b03c8..d1dc8e8 100644 --- a/inst/app-visualize/helper/linely.R +++ b/inst/app-visualize/helper/linely.R @@ -123,11 +123,3 @@ linely <- function(data, x, y, mode = 'lines', lcol = 'blue', lwidth = 1, ltype } -# data1 <- c(7.2, 7.6, 6.8, 6.5, 7) -# data2 <- c(6.8, 7.2, 7.8, 7, 6.2) -# data <- data.frame(x = data1, y = data2) -# -# p <- linely(gdp, 'india', mode = 'lines+markers', title = 'Line Chart', -# x_title = 'Year', y_title = 'Growth', axis_modify = TRUE, -# x_min = 0, x_max = 7, y_min = 4, y_max = 9) -# p diff --git a/inst/app-visualize/helper/piely.R b/inst/app-visualize/helper/piely.R index 9ff3c79..478ed7f 100644 --- a/inst/app-visualize/helper/piely.R +++ b/inst/app-visualize/helper/piely.R @@ -204,5 +204,3 @@ piely <- function(data = NULL, x = NULL, text_pos = 'inside', text_font = 'Arial } -p <- piely(mtcars, 'cyl') -p diff --git a/inst/app-visualize/helper/scatter-plot.R b/inst/app-visualize/helper/scatter-plot.R index 62c8c5b..a398ef1 100644 --- a/inst/app-visualize/helper/scatter-plot.R +++ b/inst/app-visualize/helper/scatter-plot.R @@ -37,10 +37,3 @@ scatter_plot <- function(x, y, title = NA, sub = NA, xlab = NA, } -# scatter plot test -# scatter_plot(mtcars$disp, mtcars$mpg, -# title = "Scatter Plot", sub = "Fuck", xlab = "Boobs", ylab ="Tits", -# xlim_min = 0, xlim_max = 600, ylim_min = 0, ylim_max = 50, colours = "red", -# m_text = "Fuck You", m_side = 3, m_line = 0.5, m_adj = 1) - - diff --git a/inst/app-visualize/helper/scatterly.R b/inst/app-visualize/helper/scatterly.R index 9618641..9d816c7 100644 --- a/inst/app-visualize/helper/scatterly.R +++ b/inst/app-visualize/helper/scatterly.R @@ -216,11 +216,3 @@ scatterly <- function(data, x, y, name = NA, text = NA, } - -# test -mtcars$cyl <- as.factor(mtcars$cyl) -scatterly(mtcars, 'disp', 'mpg', text = 'disp, mpg', size = 8, color = 'cyl', - title = 'Displacement vs Mileage', axis_range = FALSE, - x_min = 0, x_max = 600, y_min = 0, y_max = 50, - x_title = 'Displacement', y_title = 'Miles Per Gallon', - show_legend = TRUE, x_showgrid = F, fit_line = T) diff --git a/inst/app-visualize/helper/ubar_plot.R b/inst/app-visualize/helper/ubar_plot.R index 3b2660f..45128c9 100644 --- a/inst/app-visualize/helper/ubar_plot.R +++ b/inst/app-visualize/helper/ubar_plot.R @@ -1,15 +1,3 @@ -# activity flow -# Step 1: Upload data or use demo data - -# Step 2: Choose the type of data being plotted -# Options: a. Grouped Data -# b. Ungrouped Data - -# Step 3: Choose whether a single plot should be built or multiple plots based on a grouping variable -# Options: Select a grouping variable - - - # barplot # univariate bar_plotu <- function(x, horizontal = FALSE, color = NULL, border = "black", diff --git a/inst/app-visualize/helper/unibar.R b/inst/app-visualize/helper/unibar.R index 616c7a8..5bdc45b 100644 --- a/inst/app-visualize/helper/unibar.R +++ b/inst/app-visualize/helper/unibar.R @@ -31,6 +31,3 @@ highbar <- function(data, column, title = '', name = '', horizontal = FALSE) { } -highbar(mtcars, 'cyl', horizontal = TRUE) -data <- mtcars -column <- 'cyl' diff --git a/inst/app-visualize/helper/utils.R b/inst/app-visualize/helper/utils.R index b48b568..c87d1fb 100644 --- a/inst/app-visualize/helper/utils.R +++ b/inst/app-visualize/helper/utils.R @@ -298,29 +298,6 @@ pol_t <- function(l1, l2, df, col) { } -# ss <- function(x) { -# return(x ^ 2) -# } -# -# fl <- function(x, w) { -# x <- as.character(x) -# ret <- format(x, width = w, justify = "left") -# return(ret) -# } -# -# fc <- function(x, w) { -# x <- as.character(x) -# ret <- format(x, width = w, justify = "centre") -# return(ret) -# } -# formatrc <- function(x, w) { -# x <- as.character(x) -# ret <- format(x, width = w, justify = "right") -# return(ret) -# } - - - paired_data <- function(x, y) { d <- tibble(x = x, y = y) %>% mutate(z = x - y) %>% diff --git a/inst/app-visualize/logic/logic_bar.R b/inst/app-visualize/logic/logic_bar.R index 4054f59..f9a896e 100644 --- a/inst/app-visualize/logic/logic_bar.R +++ b/inst/app-visualize/logic/logic_bar.R @@ -1,12 +1,5 @@ source("helper/ubar_plot.R") - - - # update variable selection for bar plots - # observe({ - # updateSelectInput(session, 'ubar_select', choices = names(data())) - # }) - observeEvent(input$finalok, { f_data <- final_split$train[, sapply(final_split$train, is.factor)] @@ -166,50 +159,6 @@ source("helper/ubar_plot.R") colors }) - # # dynamic UI for shading density - # output$ui_nbardensity <- renderUI({ - # ncol <- as.integer(input$nbardensity) - - # lapply(1:ncol, function(i) { - # numericInput(paste("n_bardensity_", i), - # label = paste0("Bar ", i, " Density"), - # value = 0, min = 0) - # }) - # }) - - # density_bar <- reactive({ - # ncol <- as.integer(input$nbardensity) - - # collect <- list(lapply(1:ncol, function(i) { - # input[[paste("n_bardensity_", i)]] - # })) - - # colors <- unlist(collect) - - # }) - - # # dynamic UI for shading angle - # output$ui_nbarangle <- renderUI({ - # ncol <- as.integer(input$nbarangle) - - # lapply(1:ncol, function(i) { - # numericInput(paste("n_barangle_", i), - # label = paste0("Bar ", i, " Angle"), - # value = 0, min = 0) - # }) - # }) - - # angle_bar <- reactive({ - # ncol <- as.integer(input$nbarangle) - - # collect <- list(lapply(1:ncol, function(i) { - # input[[paste("n_barangle_", i)]] - # })) - - # colors <- unlist(collect) - - # }) - # dynamic UI for legend names output$ui_legnames <- renderUI({ ncol <- as.integer(input$leg_names) diff --git a/inst/app-visualize/logic/logic_bar2.R b/inst/app-visualize/logic/logic_bar2.R index f67fc35..5b5e820 100644 --- a/inst/app-visualize/logic/logic_bar2.R +++ b/inst/app-visualize/logic/logic_bar2.R @@ -179,71 +179,6 @@ source("helper/bbar-plot.R") colors }) - # dynamic UI for bar space - # output$ui_nbarspace2 <- renderUI({ - # ncol <- as.integer(input$nbarspace2) - # - # lapply(1:ncol, function(i) { - # numericInput(paste("n_bar2space_", i), - # label = paste0("n_bar2space_", i), - # value = 0, min = 0, max = 2, step = 1) - # }) - # }) - # - # spaces_bar2 <- reactive({ - # ncol <- as.integer(input$nbarspace2) - # - # collect <- list(lapply(1:ncol, function(i) { - # input[[paste("n_bar2space_", i)]] - # })) - # - # colors <- unlist(collect) - # - # }) - - # # dynamic UI for shading density - # output$ui_nbardensity2 <- renderUI({ - # ncol <- as.integer(input$nbardensity2) - - # lapply(1:ncol, function(i) { - # numericInput(paste("n_bar2density_", i), - # label = paste0("Bar ", i, " Density"), - # value = 1, min = 1) - # }) - # }) - - # density_bar2 <- reactive({ - # ncol <- as.integer(input$nbardensity2) - - # collect <- list(lapply(1:ncol, function(i) { - # input[[paste("n_bar2density_", i)]] - # })) - - # colors <- unlist(collect) - - # }) - - # # dynamic UI for shading angle - # output$ui_nbarangle2 <- renderUI({ - # ncol <- as.integer(input$nbarangle2) - - # lapply(1:ncol, function(i) { - # numericInput(paste("n_bar2angle_", i), - # label = paste0("Bar ", i, " Shading Angle"), - # value = 1, min = 1) - # }) - # }) - - # angle_bar2 <- reactive({ - # ncol <- as.integer(input$nbarangle2) - - # collect <- list(lapply(1:ncol, function(i) { - # input[[paste("n_bar2angle_", i)]] - # })) - - # colors <- unlist(collect) - - # }) # dynamic UI for legend names output$ui_bar2_legnames <- renderUI({ diff --git a/inst/app-visualize/logic/logic_bar_plot_1.R b/inst/app-visualize/logic/logic_bar_plot_1.R index fdd404b..5e9fb50 100644 --- a/inst/app-visualize/logic/logic_bar_plot_1.R +++ b/inst/app-visualize/logic/logic_bar_plot_1.R @@ -1,5 +1,4 @@ source('helper/barly1.R') -source('helper/bobar.R') source('helper/unibar.R') observeEvent(input$finalok, { @@ -13,17 +12,13 @@ observeEvent(input$finalok, { colnames(fdata) <- j updateSelectInput(session, 'barly1_select_x', choices = names(fdata), selected = names(fdata)) - updateSelectInput(session, 'bobar1_select_x', - choices = names(fdata), selected = names(fdata)) updateSelectInput(session, 'hibar1_select_x', choices = names(fdata), selected = names(fdata)) } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'barly1_select_x', choices = '', selected = '') - updateSelectInput(session, 'bobar1_select_x', choices = '', selected = '') updateSelectInput(session, 'hibar1_select_x', choices = '', selected = '') } else { updateSelectInput(session, 'barly1_select_x', choices = names(f_data)) - updateSelectInput(session, 'bobar1_select_x', choices = names(f_data)) updateSelectInput(session, 'hibar1_select_x', choices = names(f_data)) } }) @@ -39,17 +34,13 @@ observeEvent(input$submit_part_train_per, { colnames(fdata) <- j updateSelectInput(session, 'barly1_select_x', choices = names(fdata), selected = names(fdata)) - updateSelectInput(session, 'bobar1_select_x', - choices = names(fdata), selected = names(fdata)) updateSelectInput(session, 'hibar1_select_x', choices = names(fdata), selected = names(fdata)) } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'barly1_select_x', choices = '', selected = '') - updateSelectInput(session, 'bobar1_select_x', choices = '', selected = '') updateSelectInput(session, 'hibar1_select_x', choices = '', selected = '') } else { updateSelectInput(session, 'barly1_select_x', choices = names(f_data)) - updateSelectInput(session, 'bobar1_select_x', choices = names(f_data)) updateSelectInput(session, 'hibar1_select_x', choices = names(f_data)) } }) @@ -62,16 +53,6 @@ output$barly1_plot_1 <- plotly::renderPlotly({ b_text = input$barly1_btext) }) -output$bobar1_plot_1 <- rbokeh::renderRbokeh({ - bobar(data = final_split$train, x_data = input$bobar1_select_x, - fig_title = input$bobar1_title, x_lab = input$bobar1_xlabel, - y_lab = input$bobar1_ylabel, x_grid = input$bobar1_xgrid, - y_grid = input$bobar1_ygrid, bar_width = input$bobar1_width, - bar_hover = input$bobar1_hover, bar_col = input$bobar1_color, - bar_f_alpha = input$bobar1_alpha, bar_l_col = input$bobar1_lcolor, - bar_l_alpha = input$bobar1_lalpha) -}) - output$hibar1_plot_1 <- highcharter::renderHighchart({ highbar(data = final_split$train, column = input$hibar1_select_x, title = input$hibar1_title, name = input$hibar1_xlabel) diff --git a/inst/app-visualize/logic/logic_bar_plot_2.R b/inst/app-visualize/logic/logic_bar_plot_2.R index 37f9cf1..011504c 100644 --- a/inst/app-visualize/logic/logic_bar_plot_2.R +++ b/inst/app-visualize/logic/logic_bar_plot_2.R @@ -1,5 +1,4 @@ source('helper/barly2.R') -source('helper/bobar2.R') source('helper/bibar.R') observeEvent(input$finalok, { @@ -15,10 +14,6 @@ observeEvent(input$finalok, { choices = names(fdata), selected = names(fdata)) updateSelectInput(session, 'barly2_select_y', choices = names(fdata), selected = names(fdata)) - updateSelectInput(session, 'bobar2_select_x', - choices = names(fdata), selected = names(fdata)) - updateSelectInput(session, 'bobar2_select_y', - choices = names(fdata), selected = names(fdata)) updateSelectInput(session, 'hibar2_select_x', choices = names(fdata), selected = names(fdata)) updateSelectInput(session, 'hibar2_select_y', @@ -26,15 +21,11 @@ observeEvent(input$finalok, { } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'barly2_select_x', choices = '', selected = '') updateSelectInput(session, 'barly2_select_y', choices = '', selected = '') - updateSelectInput(session, 'bobar2_select_x', choices = '', selected = '') - updateSelectInput(session, 'bobar2_select_y', choices = '', selected = '') updateSelectInput(session, 'hibar2_select_x', choices = '', selected = '') updateSelectInput(session, 'hibar2_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'barly2_select_x', choices = names(f_data)) updateSelectInput(session, 'barly2_select_y', choices = names(f_data)) - updateSelectInput(session, 'bobar2_select_x', choices = names(f_data)) - updateSelectInput(session, 'bobar2_select_y', choices = names(f_data)) updateSelectInput(session, 'hibar2_select_x', choices = names(f_data)) updateSelectInput(session, 'hibar2_select_y', choices = names(f_data)) } @@ -53,10 +44,6 @@ observeEvent(input$submit_part_train_per, { choices = names(fdata), selected = names(fdata)) updateSelectInput(session, 'barly2_select_y', choices = names(fdata), selected = names(fdata)) - updateSelectInput(session, 'bobar2_select_x', - choices = names(fdata), selected = names(fdata)) - updateSelectInput(session, 'bobar2_select_y', - choices = names(fdata), selected = names(fdata)) updateSelectInput(session, 'hibar2_select_x', choices = names(fdata), selected = names(fdata)) updateSelectInput(session, 'hibar2_select_y', @@ -64,15 +51,11 @@ observeEvent(input$submit_part_train_per, { } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'barly2_select_x', choices = '', selected = '') updateSelectInput(session, 'barly2_select_y', choices = '', selected = '') - updateSelectInput(session, 'bobar2_select_x', choices = '', selected = '') - updateSelectInput(session, 'bobar2_select_y', choices = '', selected = '') updateSelectInput(session, 'hibar2_select_x', choices = '', selected = '') updateSelectInput(session, 'hibar2_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'barly2_select_x', choices = names(f_data)) updateSelectInput(session, 'barly2_select_y', choices = names(f_data)) - updateSelectInput(session, 'bobar2_select_x', choices = names(f_data)) - updateSelectInput(session, 'bobar2_select_y', choices = names(f_data)) updateSelectInput(session, 'hibar2_select_x', choices = names(f_data)) updateSelectInput(session, 'hibar2_select_y', choices = names(f_data)) } @@ -85,16 +68,6 @@ output$barly2_plot_1 <- plotly::renderPlotly({ x_title = input$barly2_xlabel, y_title = input$barly2_ylabel) }) -output$bobar2_plot_1 <- rbokeh::renderRbokeh({ - bobar2(data = final_split$train, var_1 = input$bobar2_select_x, - var_2 = input$bobar2_select_y, fig_title = input$bobar2_title, - x_lab = input$bobar2_xlabel, y_lab = input$bobar2_ylabel, - x_grid = input$bobar2_xgrid, y_grid = input$bobar2_ygrid, - legend_loc = input$bobar2_legloc, bar_pos = input$bobar2_type, - bar_hover = input$bobar2_hover, bar_width = input$bobar2_width, - bar_f_alpha = input$bobar2_alpha) -}) - output$hibar2_plot_1 <- highcharter::renderHighchart({ bibar(data = final_split$train, x = input$hibar2_select_x, y = input$hibar2_select_y, horizontal = input$hibar2_horiz, diff --git a/inst/app-visualize/logic/logic_box_plot_1.R b/inst/app-visualize/logic/logic_box_plot_1.R index e9cd4ed..9990e2f 100644 --- a/inst/app-visualize/logic/logic_box_plot_1.R +++ b/inst/app-visualize/logic/logic_box_plot_1.R @@ -1,5 +1,4 @@ source('helper/boxly1.R') -source('helper/bobox.R') observeEvent(input$finalok, { num_data <- final_split$train[, sapply(final_split$train, is.numeric)] @@ -10,16 +9,11 @@ observeEvent(input$finalok, { colnames(numdata) <- j updateSelectInput(session, 'boxly1_select_x', choices = names(numdata), selected = names(numdata)) - updateSelectInput(session, 'bobox1_select_x', - choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'boxly1_select_x', choices = '', selected = '') - updateSelectInput(session, 'bobox1_select_x', - choices = '', selected = '') } else { updateSelectInput(session, 'boxly1_select_x', choices = names(num_data)) - updateSelectInput(session, 'bobox1_select_x', choices = names(num_data)) } }) @@ -33,16 +27,11 @@ observeEvent(input$submit_part_train_per, { colnames(numdata) <- j updateSelectInput(session, 'boxly1_select_x', choices = names(numdata), selected = names(numdata)) - updateSelectInput(session, 'bobox1_select_x', - choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'boxly1_select_x', choices = '', selected = '') - updateSelectInput(session, 'bobox1_select_x', - choices = '', selected = '') } else { updateSelectInput(session, 'boxly1_select_x', choices = names(num_data)) - updateSelectInput(session, 'bobox1_select_x', choices = names(num_data)) } }) @@ -54,12 +43,3 @@ output$boxly1_plot_1 <- plotly::renderPlotly({ x_title = NULL, y_title = input$boxly1_ylabel) }) -output$bobox1_plot_1 <- rbokeh::renderRbokeh({ - bobox(data = final_split$train, x_data = input$bobox1_select_x, - fig_title = input$bobox1_title, x_lab = input$bobox1_xlabel, - y_lab = input$bobox1_ylabel, , - x_grid = input$bobox1_xgrid, y_grid = input$bobox1_ygrid, - box_w = input$bobox1_width, box_col = input$bobox1_color, - box_alp = input$bobox1_alpha, box_l_col = input$bobox1_lcolor, - box_out_gly = input$bobox1_oshape, box_out_size = input$bobox1_osize) -}) diff --git a/inst/app-visualize/logic/logic_box_plot_2.R b/inst/app-visualize/logic/logic_box_plot_2.R index 1696032..2b72756 100644 --- a/inst/app-visualize/logic/logic_box_plot_2.R +++ b/inst/app-visualize/logic/logic_box_plot_2.R @@ -1,5 +1,4 @@ source('helper/boxly2.R') -source('helper/bobox2.R') source('helper/hibox2.R') observeEvent(input$finalok, { @@ -11,17 +10,13 @@ observeEvent(input$finalok, { colnames(numdata) <- j updateSelectInput(session, 'boxly2_select_y', choices = names(numdata), selected = names(numdata)) - updateSelectInput(session, 'bobox2_select_y', - choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hibox2_select_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'boxly2_select_y', choices = '', selected = '') - updateSelectInput(session, 'bobox2_select_y', choices = '', selected = '') updateSelectInput(session, 'hibox2_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'boxly2_select_y', choices = names(num_data)) - updateSelectInput(session, 'bobox2_select_y', choices = names(num_data)) updateSelectInput(session, 'hibox2_select_y', choices = names(num_data)) } @@ -34,17 +29,13 @@ observeEvent(input$finalok, { colnames(fdata) <- j updateSelectInput(session, 'boxly2_select_x', choices = names(fdata), selected = names(fdata)) - updateSelectInput(session, 'bobox2_select_x', - choices = names(fdata), selected = names(fdata)) updateSelectInput(session, 'hibox2_select_x', choices = names(fdata), selected = names(fdata)) } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'boxly2_select_x', choices = '', selected = '') - updateSelectInput(session, 'bobox2_select_x', choices = '', selected = '') updateSelectInput(session, 'hibox2_select_x', choices = '', selected = '') } else { updateSelectInput(session, 'boxly2_select_x', choices = names(f_data)) - updateSelectInput(session, 'bobox2_select_x', choices = names(f_data)) updateSelectInput(session, 'hibox2_select_x', choices = names(f_data)) } @@ -60,17 +51,13 @@ observeEvent(input$submit_part_train_per, { colnames(numdata) <- j updateSelectInput(session, 'boxly2_select_y', choices = names(numdata), selected = names(numdata)) - updateSelectInput(session, 'bobox2_select_y', - choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hibox2_select_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'boxly2_select_y', choices = '', selected = '') - updateSelectInput(session, 'bobox2_select_y', choices = '', selected = '') updateSelectInput(session, 'hibox2_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'boxly2_select_y', choices = names(num_data)) - updateSelectInput(session, 'bobox2_select_y', choices = names(num_data)) updateSelectInput(session, 'hibox2_select_y', choices = names(num_data)) } @@ -83,17 +70,13 @@ observeEvent(input$submit_part_train_per, { colnames(fdata) <- j updateSelectInput(session, 'boxly2_select_x', choices = names(fdata), selected = names(fdata)) - updateSelectInput(session, 'bobox2_select_x', - choices = names(fdata), selected = names(fdata)) updateSelectInput(session, 'hibox2_select_x', choices = names(fdata), selected = names(fdata)) } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'boxly2_select_x', choices = '', selected = '') - updateSelectInput(session, 'bobox2_select_x', choices = '', selected = '') updateSelectInput(session, 'hibox2_select_x', choices = '', selected = '') } else { updateSelectInput(session, 'boxly2_select_x', choices = names(f_data)) - updateSelectInput(session, 'bobox2_select_x', choices = names(f_data)) updateSelectInput(session, 'hibox2_select_x', choices = names(f_data)) } }) @@ -105,17 +88,6 @@ output$boxly2_plot_1 <- plotly::renderPlotly({ x_title = input$boxly2_ylabel, y_title = input$boxly2_ylabel) }) - -output$bobox2_plot_1 <- rbokeh::renderRbokeh({ - bobox2(data = final_split$train, y_data = input$bobox2_select_y, - x_data = input$bobox2_select_x, fig_title = input$bobox2_title, - x_lab = input$bobox2_ylabel, y_lab = input$bobox2_ylabel, - x_grid = input$bobox2_xgrid, y_grid = input$bobox2_ygrid, - box_w = input$bobox2_width, box_alp = input$bobox2_alpha, - box_out_gly = input$bobox2_oshape, box_out_size = input$bobox2_osize, - legend_loc = input$bobox2_legloc) -}) - output$hibox2_plot_1 <- highcharter::renderHighchart({ highbox(data = final_split$train, y = input$hibox2_select_y, x = input$hibox2_select_x, title = input$hibox2_title, diff --git a/inst/app-visualize/logic/logic_dataoptions.R b/inst/app-visualize/logic/logic_dataoptions.R index ead875f..9d5db78 100644 --- a/inst/app-visualize/logic/logic_dataoptions.R +++ b/inst/app-visualize/logic/logic_dataoptions.R @@ -28,42 +28,6 @@ file_upload_options <- eventReactive(input$upload_files_yes, { label = 'XLSX', width = '120px' ) - ), - column(3, align = 'center', - actionButton( - inputId = 'upload_json_file', - label = 'JSON', - width = '120px' - ) - ), - column(12, br()), - column(3, align = 'center', - actionButton( - inputId = 'upload_stata_file', - label = 'STATA', - width = '120px' - ) - ), - column(3, align = 'center', - actionButton( - inputId = 'upload_spss_file', - label = 'SPSS', - width = '120px' - ) - ), - column(3, align = 'center', - actionButton( - inputId = 'upload_sas_file', - label = 'SAS', - width = '120px' - ) - ), - column(3, align = 'center', - actionButton( - inputId = 'upload_rds_file', - label = 'RDS', - width = '120px' - ) ) ) @@ -90,33 +54,3 @@ observeEvent(input$upload_xlsx_file, { updateNavlistPanel(session, 'navlist_up', 'tab_uploadfile') updateTabsetPanel(session, 'tabset_upload', selected = 'tab_upload_excel') }) - -observeEvent(input$upload_json_file, { - updateNavbarPage(session, 'mainpage', selected = 'tab_upload') - updateNavlistPanel(session, 'navlist_up', 'tab_uploadfile') - updateTabsetPanel(session, 'tabset_upload', selected = 'tab_upload_json') -}) - -observeEvent(input$upload_stata_file, { - updateNavbarPage(session, 'mainpage', selected = 'tab_upload') - updateNavlistPanel(session, 'navlist_up', 'tab_uploadfile') - updateTabsetPanel(session, 'tabset_upload', selected = 'tab_upload_stata') -}) - -observeEvent(input$upload_spss_file, { - updateNavbarPage(session, 'mainpage', selected = 'tab_upload') - updateNavlistPanel(session, 'navlist_up', 'tab_uploadfile') - updateTabsetPanel(session, 'tabset_upload', selected = 'tab_upload_spss') -}) - -observeEvent(input$upload_sas_file, { - updateNavbarPage(session, 'mainpage', selected = 'tab_upload') - updateNavlistPanel(session, 'navlist_up', 'tab_uploadfile') - updateTabsetPanel(session, 'tabset_upload', selected = 'tab_upload_sas') -}) - -observeEvent(input$upload_rds_file, { - updateNavbarPage(session, 'mainpage', selected = 'tab_upload') - updateNavlistPanel(session, 'navlist_up', 'tab_uploadfile') - updateTabsetPanel(session, 'tabset_upload', selected = 'tab_upload_rds') -}) \ No newline at end of file diff --git a/inst/app-visualize/logic/logic_hist_prh.R b/inst/app-visualize/logic/logic_hist_prh.R index d42b0e9..74f7f70 100644 --- a/inst/app-visualize/logic/logic_hist_prh.R +++ b/inst/app-visualize/logic/logic_hist_prh.R @@ -1,5 +1,4 @@ source('helper/histly.R') -source('helper/bohist.R') source('helper/highhist.R') observeEvent(input$finalok, { @@ -11,17 +10,13 @@ observeEvent(input$finalok, { colnames(numdata) <- j updateSelectInput(session, 'histly_select_x', choices = names(numdata), selected = names(numdata)) - updateSelectInput(session, 'bohist_select_x', - choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hihist_select_x', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'histly_select_x', choices = '', selected = '') - updateSelectInput(session, 'bohist_select_x', choices = '', selected = '') updateSelectInput(session, 'hihist_select_x', choices = '', selected = '') } else { updateSelectInput(session, 'histly_select_x', choices = names(num_data)) - updateSelectInput(session, 'bohist_select_x', choices = names(num_data)) updateSelectInput(session, 'hihist_select_x', choices = names(num_data)) } @@ -37,17 +32,13 @@ observeEvent(input$submit_part_train_per, { colnames(numdata) <- j updateSelectInput(session, 'histly_select_x', choices = names(numdata), selected = names(numdata)) - updateSelectInput(session, 'bohist_select_x', - choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hihist_select_x', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'histly_select_x', choices = '', selected = '') - updateSelectInput(session, 'bohist_select_x', choices = '', selected = '') updateSelectInput(session, 'hihist_select_x', choices = '', selected = '') } else { updateSelectInput(session, 'histly_select_x', choices = names(num_data)) - updateSelectInput(session, 'bohist_select_x', choices = names(num_data)) updateSelectInput(session, 'hihist_select_x', choices = names(num_data)) } @@ -81,17 +72,6 @@ output$histly_plot_1 <- plotly::renderPlotly({ } }) -output$bohist_plot_1 <- rbokeh::renderRbokeh({ - bohist(data = final_split$train, x_data = input$bohist_select_x, - fig_title = input$bohist_title, x_lab = input$bohist_xlabel, - y_lab = input$bohist_ylabel, h_breaks = input$bohist_breaks, - h_freq = input$bohist_density, h_incl_low = input$bohist_lowest, - h_right = input$bohist_right, h_fill_col = input$bohist_color, - add_density = input$bohist_add, den_col = input$bohist_dcolor, - den_alpha = input$bohist_dalpha, den_width = input$bohist_dwidth, - den_type = input$bohist_dtype) -}) - output$hihist_plot_1 <- highcharter::renderHighchart({ highist(data = final_split$train, column = input$hihist_select_x, xlab = input$hihist_xlabel, color = input$hihist_color) diff --git a/inst/app-visualize/logic/logic_line_prh.R b/inst/app-visualize/logic/logic_line_prh.R index fae12a5..008335d 100644 --- a/inst/app-visualize/logic/logic_line_prh.R +++ b/inst/app-visualize/logic/logic_line_prh.R @@ -1,5 +1,4 @@ source('helper/linely.R') -source('helper/boline.R') source('helper/highline.R') observeEvent(input$finalok, { @@ -31,10 +30,6 @@ observeEvent(input$finalok, { choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'linely_select_y', choices = names(numdata), selected = names(numdata)) - updateSelectInput(session, 'boline_select_x', - choices = names(numdata), selected = names(numdata)) - updateSelectInput(session, 'boline_select_y', - choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hiline_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hiline_select_y', @@ -42,15 +37,11 @@ observeEvent(input$finalok, { } else if (ncol(num_data) < 1) { updateSelectInput(session, 'linely_select_x', choices = '', selected = '') updateSelectInput(session, 'linely_select_y', choices = '', selected = '') - updateSelectInput(session, 'boline_select_x', choices = '', selected = '') - updateSelectInput(session, 'boline_select_y', choices = '', selected = '') updateSelectInput(session, 'hiline_select_x', choices = '', selected = '') updateSelectInput(session, 'hiline_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'linely_select_x', choices = names(num_data), selected = names(num_data)) updateSelectInput(session, 'linely_select_y', choices = names(num_data), selected = names(num_data)) - updateSelectInput(session, 'boline_select_x', choices = names(num_data), selected = names(num_data)) - updateSelectInput(session, 'boline_select_y', choices = names(num_data), selected = names(num_data)) updateSelectInput(session, 'hiline_select_x', choices = names(num_data), selected = names(num_data)) updateSelectInput(session, 'hiline_select_y', choices = names(num_data), selected = names(num_data)) } @@ -87,10 +78,6 @@ observeEvent(input$submit_part_train_per, { choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'linely_select_y', choices = names(numdata), selected = names(numdata)) - updateSelectInput(session, 'boline_select_x', - choices = names(numdata), selected = names(numdata)) - updateSelectInput(session, 'boline_select_y', - choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hiline_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hiline_select_y', @@ -98,15 +85,11 @@ observeEvent(input$submit_part_train_per, { } else if (ncol(num_data) < 1) { updateSelectInput(session, 'linely_select_x', choices = '', selected = '') updateSelectInput(session, 'linely_select_y', choices = '', selected = '') - updateSelectInput(session, 'boline_select_x', choices = '', selected = '') - updateSelectInput(session, 'boline_select_y', choices = '', selected = '') updateSelectInput(session, 'hiline_select_x', choices = '', selected = '') updateSelectInput(session, 'hiline_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'linely_select_x', choices = names(num_data), selected = names(num_data)) updateSelectInput(session, 'linely_select_y', choices = names(num_data), selected = names(num_data)) - updateSelectInput(session, 'boline_select_x', choices = names(num_data), selected = names(num_data)) - updateSelectInput(session, 'boline_select_y', choices = names(num_data), selected = names(num_data)) updateSelectInput(session, 'hiline_select_x', choices = names(num_data), selected = names(num_data)) updateSelectInput(session, 'hiline_select_y', choices = names(num_data), selected = names(num_data)) } @@ -122,14 +105,6 @@ output$linely_plot_1 <- plotly::renderPlotly({ ltype = input$linely_type) }) -output$boline_plot_1 <- rbokeh::renderRbokeh({ - boline(data = final_split$train, x_data = input$boline_select_x, - fig_title = input$boline_title, x_lab = input$boline_xlabel, - y_lab = input$boline_ylabel, y_data = input$boline_select_y, - l_color = input$boline_color, l_type = input$boline_type, - l_width = input$boline_width, l_alpha = input$boline_alpha) -}) - output$hiline_plot_1 <- highcharter::renderHighchart({ highline(data = final_split$train, x = input$hiline_select_x, columns = input$hiline_select_y, add_labels = input$hiline_labels) diff --git a/inst/app-visualize/logic/logic_scatter_prh.R b/inst/app-visualize/logic/logic_scatter_prh.R index 539c9fb..38e973a 100644 --- a/inst/app-visualize/logic/logic_scatter_prh.R +++ b/inst/app-visualize/logic/logic_scatter_prh.R @@ -1,5 +1,4 @@ source('helper/scatterly.R') -source('helper/boscatter.R') source('helper/hscatter.R') observeEvent(input$finalok, { @@ -14,10 +13,6 @@ observeEvent(input$finalok, { choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'scatly_select_y', choices = names(numdata), selected = names(numdata)) - updateSelectInput(session, 'boscat_select_x', - choices = names(numdata), selected = names(numdata)) - updateSelectInput(session, 'boscat_select_y', - choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hiscat_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hiscat_select_y', @@ -27,10 +22,6 @@ observeEvent(input$finalok, { choices = '', selected = '') updateSelectInput(session, 'scatly_select_y', choices = '', selected = '') - updateSelectInput(session, 'boscat_select_x', - choices = '', selected = '') - updateSelectInput(session, 'boscat_select_y', - choices = '', selected = '') updateSelectInput(session, 'hiscat_select_x', choices = '', selected = '') updateSelectInput(session, 'hiscat_select_y', @@ -38,8 +29,6 @@ observeEvent(input$finalok, { } else { updateSelectInput(session, 'scatly_select_x', choices = names(num_data)) updateSelectInput(session, 'scatly_select_y', choices = names(num_data)) - updateSelectInput(session, 'boscat_select_x', choices = names(num_data)) - updateSelectInput(session, 'boscat_select_y', choices = names(num_data)) updateSelectInput(session, 'hiscat_select_x', choices = names(num_data)) updateSelectInput(session, 'hiscat_select_y', choices = names(num_data)) } @@ -58,10 +47,6 @@ observeEvent(input$submit_part_train_per, { choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'scatly_select_y', choices = names(numdata), selected = names(numdata)) - updateSelectInput(session, 'boscat_select_x', - choices = names(numdata), selected = names(numdata)) - updateSelectInput(session, 'boscat_select_y', - choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hiscat_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hiscat_select_y', @@ -71,10 +56,6 @@ observeEvent(input$submit_part_train_per, { choices = '', selected = '') updateSelectInput(session, 'scatly_select_y', choices = '', selected = '') - updateSelectInput(session, 'boscat_select_x', - choices = '', selected = '') - updateSelectInput(session, 'boscat_select_y', - choices = '', selected = '') updateSelectInput(session, 'hiscat_select_x', choices = '', selected = '') updateSelectInput(session, 'hiscat_select_y', @@ -82,8 +63,6 @@ observeEvent(input$submit_part_train_per, { } else { updateSelectInput(session, 'scatly_select_x', choices = names(num_data)) updateSelectInput(session, 'scatly_select_y', choices = names(num_data)) - updateSelectInput(session, 'boscat_select_x', choices = names(num_data)) - updateSelectInput(session, 'boscat_select_y', choices = names(num_data)) updateSelectInput(session, 'hiscat_select_x', choices = names(num_data)) updateSelectInput(session, 'hiscat_select_y', choices = names(num_data)) } @@ -100,38 +79,6 @@ output$scatly_plot_1 <- plotly::renderPlotly({ line_type = input$scatly_ltype, line_width = input$scatly_lsize) }) -# fitstat <- eventReactive({ -# model <- lm(input$boscat_select_y ~ input$boscat_select_x, data = final_split$train) -# return(model$coefficients) -# }) - -# intercept <- reactive({ -# fitstat()[[1]] -# }) - -# slope <- reactive({ -# fitstat()[[2]] -# }) - -# observe({ -# updateNumericInput(session, inputId = "boscat_fint", value = intercept()) -# updateNumericInput(session, inputId = "boscat_fslope", value = slope()) -# }) - -output$boscat_plot_1 <- rbokeh::renderRbokeh({ - bokatter(data = final_split$train, y_data = input$boscat_select_y, - x_data = input$boscat_select_x, fig_title = input$boscat_title, - x_lab = input$boscat_xlabel, y_lab = input$boscat_ylabel, - x_grid = input$boscat_xgrid, y_grid = input$boscat_ygrid, - glyph = input$boscat_shape, point_size = input$boscat_size, - inner_col = input$boscat_color, inner_alpha = input$boscat_alpha, - add_line = input$boscat_fitline, line_a = input$boscat_fint, - line_b = input$boscat_fslope, line_color = input$boscat_lcolor, - line_alpha = input$boscat_lalpha, line_width = input$boscat_lwidth, - line_type = input$boscat_ltype) -}) - - output$hiscat_plot_1 <- highcharter::renderHighchart({ hscatter(data = final_split$train, x = input$hiscat_select_x, y = input$hiscat_select_y, xax_title = input$hiscat_xlabel, @@ -140,4 +87,4 @@ output$hiscat_plot_1 <- highcharter::renderHighchart({ point_shape = input$hiscat_symbol, fit_line = input$hiscat_fit, line_col = input$hiscat_lcol, line_width = input$hiscat_lsize, point_on_line = FALSE, title = input$hiscat_title, sub = input$hiscat_subtitle) -}) \ No newline at end of file +}) diff --git a/inst/app-visualize/logic/logic_upload.R b/inst/app-visualize/logic/logic_upload.R index bd4fa2d..dccb44c 100644 --- a/inst/app-visualize/logic/logic_upload.R +++ b/inst/app-visualize/logic/logic_upload.R @@ -35,10 +35,10 @@ data2 <- reactive({ ext <- tools::file_ext(inFile2()$name) file.rename(inFile2()$datapath, - paste(inFile2()$datapath, ext, sep=".")) + paste(inFile2()$datapath, ext, sep = ".")) readxl::read_excel( - path = paste(inFile2()$datapath, ext, sep="."), + path = paste(inFile2()$datapath, ext, sep = "."), sheet = input$sheet_n ) } diff --git a/inst/app-visualize/logic/logic_view.R b/inst/app-visualize/logic/logic_view.R index d65bacd..def46d6 100644 --- a/inst/app-visualize/logic/logic_view.R +++ b/inst/app-visualize/logic/logic_view.R @@ -1,4 +1,4 @@ -output$table <- renderDataTable({ +output$table <- renderDT({ final_split$train }) @@ -10,4 +10,4 @@ observeEvent(input$view2getdata, { observeEvent(input$view2analyze, { updateNavbarPage(session, 'mainpage', selected = 'tab_eda') updateNavlistPanel(session, 'navlist_eda', 'tab_summary') -}) \ No newline at end of file +}) diff --git a/inst/app-visualize/logic/logic_vizlib.R b/inst/app-visualize/logic/logic_vizlib.R index 8fc1c4e..046b140 100644 --- a/inst/app-visualize/logic/logic_vizlib.R +++ b/inst/app-visualize/logic/logic_vizlib.R @@ -3,13 +3,10 @@ bar_libopt <- eventReactive(input$click_bar, { fluidRow( fluidRow( - column(1), + column(2), column(2, align = 'center', h5("Base R") ), - column(2, align = 'center', - h5("rbokeh") - ), column(2, align = 'center', h5("plotly") ), @@ -19,14 +16,11 @@ bar_libopt <- eventReactive(input$click_bar, { column(2, align = 'center', h5("ggplot2") ), - column(1) + column(2) ), fluidRow( - column(1), - column(2, align = 'center', - hr() - ), + column(2), column(2, align = 'center', hr() ), @@ -39,17 +33,14 @@ bar_libopt <- eventReactive(input$click_bar, { column(2, align = 'center', hr() ), - column(1) + column(2) ), fluidRow( - column(1), + column(2), column(2, align = 'center', img(src = 'Rlogonew.png', width = '100px', height = '100px') ), - column(2, align = 'center', - img(src = 'bokeh_logo.png', width = '100px', height = '100px') - ), column(2, align = 'center', img(src = 'plotly_logo.png', width = '100px', height = '100px') ), @@ -59,11 +50,11 @@ bar_libopt <- eventReactive(input$click_bar, { column(2, align = 'center', img(src = 'ggplot2_logo.png', width = '100px', height = '100px') ), - column(1) + column(2) ), fluidRow( - column(1), + column(2), column(2, align = 'center', hr() ), @@ -76,10 +67,7 @@ bar_libopt <- eventReactive(input$click_bar, { column(2, align = 'center', hr() ), - column(2, align = 'center', - hr() - ), - column(1) + column(2) ) ) @@ -92,4 +80,4 @@ output$vizlib_bar <- renderUI({ observeEvent(input$click_bar, { updateNavbarPage(session, 'mainpage', selected = 'tab_viz_lib') -}) \ No newline at end of file +}) diff --git a/inst/app-visualize/server.R b/inst/app-visualize/server.R index 65f8969..8f5537d 100644 --- a/inst/app-visualize/server.R +++ b/inst/app-visualize/server.R @@ -1,7 +1,6 @@ library(shiny) library(ggplot2) library(plotly) -library(rbokeh) library(highcharter) library(dplyr) library(purrr) @@ -15,6 +14,7 @@ library(tools) library(lubridate) library(scales) library(stringr) +library(DT) shinyServer(function(input, output, session) { diff --git a/inst/app-visualize/ui.R b/inst/app-visualize/ui.R index 0b923ee..3fd39e5 100644 --- a/inst/app-visualize/ui.R +++ b/inst/app-visualize/ui.R @@ -1,8 +1,8 @@ library(shiny) library(shinyBS) -library(shinythemes) library(descriptr) library(dplyr) +library(DT) shinyUI( navbarPage(HTML("visualizer"), id = 'mainpage', diff --git a/inst/app-visualize/ui/ui_bar_plot_1.R b/inst/app-visualize/ui/ui_bar_plot_1.R index bc5eeeb..930ce13 100644 --- a/inst/app-visualize/ui/ui_bar_plot_1.R +++ b/inst/app-visualize/ui/ui_bar_plot_1.R @@ -40,48 +40,6 @@ tabPanel('Bar Plot', value = 'tab_bar_plot_1', ) ), - tabPanel('rbokeh', - - fluidRow( - column(2, - selectInput('bobar1_select_x', 'Variable: ', - choices = "", selected = ""), - textInput(inputId = "bobar1_xlabel", label = "X Axes Label: ", - value = "label"), - textInput(inputId = "bobar1_color", label = "Color: ", - value = ""), - selectInput('bobar1_hover', 'Hover: ', - choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE" - ), - textInput(inputId = "bobar1_lcolor", label = "Line Color: ", - value = ""), - selectInput('bobar1_xgrid', 'X Axis Grid: ', - choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE" - ) - ), - - column(2, - textInput(inputId = "bobar1_title", label = "Title: ", - value = "title"), - textInput(inputId = "bobar1_ylabel", label = "Y Axes Label: ", - value = "label"), - numericInput(inputId = "bobar1_alpha", label = "Alpha: ", - value = 1, min = 0, max = 1, step = 0.1), - numericInput(inputId = "bobar1_width", label = "Width: ", - value = 0.9, min = 0, step = 0.1), - numericInput(inputId = "bobar1_lalpha", label = "Line Alpha: ", - value = 1, min = 0, max = 1, step = 0.1), - selectInput('bobar1_ygrid', 'Y Axis Grid: ', - choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE" - ) - ), - - column(8, align = 'center', - rbokeh::rbokehOutput('bobar1_plot_1', height = '600px') - ) - ) - ), - tabPanel('highcharts', fluidRow( @@ -109,4 +67,4 @@ tabPanel('Bar Plot', value = 'tab_bar_plot_1', ) ) ) -) \ No newline at end of file +) diff --git a/inst/app-visualize/ui/ui_bar_plot_2.R b/inst/app-visualize/ui/ui_bar_plot_2.R index cae4e8e..21dc6bb 100644 --- a/inst/app-visualize/ui/ui_bar_plot_2.R +++ b/inst/app-visualize/ui/ui_bar_plot_2.R @@ -38,54 +38,6 @@ tabPanel('2 Factor Bar Plot', value = 'tab_bar_plot_2', ) ), - tabPanel('rbokeh', - - fluidRow( - column(2, - selectInput('bobar2_select_x', 'Variable 1: ', - choices = "", selected = ""), - selectInput('bobar2_type', 'Type: ', - choices = c("Stacked" = "stack", "Grouped" = "dodge", "Proportional" = "fill"), - selected = "Stacked"), - textInput(inputId = "bobar2_xlabel", label = "X Axes Label: ", - value = "label"), - textInput(inputId = "bobar2_title", label = "Title: ", - value = "title"), - selectInput('bobar2_xgrid', 'X Axis Grid: ', - choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE" - ), - numericInput(inputId = "bobar2_width", label = "Width: ", - value = 0.9, min = 0, step = 0.1) - - ), - - column(2, - selectInput('bobar2_select_y', 'Variable 2: ', - choices = "", selected = ""), - selectInput('bobar2_legloc', 'Legend: ', - choices = c("Top Right" = "top_right", "Top Left" = "top_left", - "Bottom Right" = "bottom_right", "Bottom Left" = "bottom_left", "Omit" = "NULL"), - selected = "Top Right" - ), - textInput(inputId = "bobar2_ylabel", label = "Y Axes Label: ", - value = "label"), - selectInput('bobar2_hover', 'Hover: ', - choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE" - ), - selectInput('bobar2_ygrid', 'Y Axis Grid: ', - choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE" - ), - numericInput(inputId = "bobar2_alpha", label = "Alpha: ", - value = 1, min = 0, max = 1, step = 0.1) - - ), - - column(8, align = 'center', - rbokeh::rbokehOutput('bobar2_plot_1', height = '600px') - ) - ) - ), - tabPanel('highcharts', fluidRow( @@ -120,4 +72,4 @@ tabPanel('2 Factor Bar Plot', value = 'tab_bar_plot_2', ) ) ) -) \ No newline at end of file +) diff --git a/inst/app-visualize/ui/ui_box_plot_1.R b/inst/app-visualize/ui/ui_box_plot_1.R index 1294333..5eb7ec1 100644 --- a/inst/app-visualize/ui/ui_box_plot_1.R +++ b/inst/app-visualize/ui/ui_box_plot_1.R @@ -32,45 +32,6 @@ tabPanel('Box Plot', value = 'tab_box_plot_1', column(8, align = 'center', plotly::plotlyOutput('boxly1_plot_1', height = '600px') - ) - ) - ), - - tabPanel('rbokeh', - - fluidRow( - column(2, - selectInput('bobox1_select_x', 'Variable: ', - choices = "", selected = ""), - textInput(inputId = "bobox1_xlabel", label = "X Axes Label: ", - value = "label"), - textInput(inputId = "bobox1_color", label = "Color: ", - value = ""), - numericInput(inputId = "bobox1_oshape", label = "Outlier Shape: ", - value = 1, min = 0, max = 25, step = 1), - numericInput(inputId = "bobox1_width", label = "Width: ", - value = 0.9, min = 0, max = 1, step = 0.1), - selectInput('bobox1_xgrid', 'X Axis Grid: ', - choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE") - ), - - column(2, - textInput(inputId = "bobox1_title", label = "Title: ", - value = "title"), - textInput(inputId = "bobox1_ylabel", label = "Y Axes Label: ", - value = "label"), - numericInput(inputId = "bobox1_alpha", label = "Alpha: ", - value = 1, min = 0, max = 1, step = 0.1), - numericInput(inputId = "bobox1_osize", label = "Outlier Size: ", - value = 10, min = 0, step = 1), - textInput(inputId = "bobox1_lcolor", label = "Line Color: ", - value = ""), - selectInput('bobox1_ygrid', 'Y Axis Grid: ', - choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE") - ), - - column(8, align = 'center', - rbokeh::rbokehOutput('bobox1_plot_1', height = '600px') ) ) ) @@ -79,4 +40,4 @@ tabPanel('Box Plot', value = 'tab_box_plot_1', ) ) ) -) \ No newline at end of file +) diff --git a/inst/app-visualize/ui/ui_box_plot_2.R b/inst/app-visualize/ui/ui_box_plot_2.R index 6111da5..0ea60fe 100644 --- a/inst/app-visualize/ui/ui_box_plot_2.R +++ b/inst/app-visualize/ui/ui_box_plot_2.R @@ -38,43 +38,6 @@ tabPanel('2 Factor Box Plot', value = 'tab_box_plot_2', ) ), - tabPanel('rbokeh', - - fluidRow( - column(2, - selectInput('bobox2_select_x', 'Variable 1: ', - choices = "", selected = ""), - numericInput(inputId = "bobox2_oshape", label = "Outlier Shape: ", - value = 1, min = 0, max = 25, step = 1), - numericInput(inputId = "bobox2_width", label = "Width: ", - value = 0.9, min = 0, max = 1, step = 0.1), - selectInput('bobox2_xgrid', 'X Axis Grid: ', - choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE"), - textInput(inputId = "bobox2_xlabel", label = "X Axes Label: ", - value = "label"), - textInput(inputId = "bobox2_title", label = "Title: ", - value = "title") - ), - - column(2, - selectInput('bobox2_select_y', 'Variable 2: ', - choices = "", selected = ""), - numericInput(inputId = "bobox2_osize", label = "Outlier Size: ", - value = 10, min = 0, step = 1), - numericInput(inputId = "bobox2_alpha", label = "Alpha: ", - value = 1, min = 0, max = 1, step = 0.1), - selectInput('bobox2_ygrid', 'Y Axis Grid: ', - choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE"), - textInput(inputId = "bobox2_ylabel", label = "Y Axes Label: ", - value = "label") - ), - - column(8, align = 'center', - rbokeh::rbokehOutput('bobox2_plot_1', height = '600px') - ) - ) - ), - tabPanel('highcharts', fluidRow( @@ -104,4 +67,4 @@ tabPanel('2 Factor Box Plot', value = 'tab_box_plot_2', ) ) ) -) \ No newline at end of file +) diff --git a/inst/app-visualize/ui/ui_datafiles.R b/inst/app-visualize/ui/ui_datafiles.R index 7d8ed13..d1e2609 100644 --- a/inst/app-visualize/ui/ui_datafiles.R +++ b/inst/app-visualize/ui/ui_datafiles.R @@ -1,440 +1,153 @@ tabPanel('Upload File', value = 'tab_uploadfile', - fluidPage( - - includeCSS("mystyle.css"), - - fluidRow( - - column(12, - - tabsetPanel(type = 'tabs', id = 'tabset_upload', - - tabPanel('CSV', value = 'tab_upload_csv', - - fluidPage( - - br(), - - fluidRow( - column(8, align = 'left', - h4('Upload Data'), - p('Upload data from a comma or tab separated file.') - ), - column(4, align = 'right', - actionButton(inputId='uploadlink2', label="Demo", icon = icon("video-camera"), - onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=00m29s', '_blank')") - ) - ), - hr(), - - fluidRow( - column(12, align = 'center', - fileInput('file1', 'Data Set:', - accept = c('text/csv', '.csv', - 'text/comma-separated-values,text/plain') - ) - ) - ), - - fluidRow( - column(12, align = 'center', checkboxInput('header', 'Header', TRUE)) - ), - - fluidRow( - column(12, align = 'center', - selectInput('sep', 'Separator', - choices = c('Comma' = ',', 'Semicolon' = ';', 'Tab' = '\t'), selected = ',') - ) - ), - - fluidRow( - column(12, align = 'center', - selectInput('quote', 'Quote', - choices = c('None' = '', 'Double Quote' = '"', 'Single Quote' = "'"), selected = '') - ) - ), - - br(), - br(), - br(), - - fluidRow( - - column(6, align = 'left', - actionButton(inputId='csv2datasrc', label="Data Sources", icon = icon("long-arrow-left")) - ), - - column(6, align = 'right', - actionButton(inputId='csv2datatrans', label="Data Selection", icon = icon("long-arrow-right")) - ) - - ) - - ) - - ), - tabPanel('Excel', value = 'tab_upload_excel', - - fluidPage( - - br(), - - fluidRow( - column(8, align = 'left', - h4('Upload Data'), - p('Upload data from a .xls or .xlsx file.') - ), - column(4, align = 'right', - actionButton(inputId='uploadexcel2', label="Demo", icon = icon("video-camera"), - onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=00m29s', '_blank')") - ) - ), - hr(), - - fluidRow( - column(12, align = 'center', - fileInput( - inputId = 'file2', - label = 'Choose file:', - accept = c('.xls', '.xlsx') - ) - ) - ), - - fluidRow( - column(12, align = 'center', - numericInput( - inputId = 'sheet_n', - label = 'Sheet', - value = 1, - min = 1, - step = 1, - width = '120px' - ) - ) - ), - - br(), - br(), - - br(), - br(), - - br(), - br(), - br(), - br(), - br(), - - fluidRow( - - column(6, align = 'left', - actionButton(inputId='excel2datasrc', label="Data Sources", icon = icon("long-arrow-left")) - ), - - column(6, align = 'right', - actionButton(inputId='excel2datatrans', label="Data Selection", icon = icon("long-arrow-right")) - ) - - ) - - ) - - ), - tabPanel('JSON', value = 'tab_upload_json', - - br(), - - fluidPage( - - fluidRow( - column(8, align = 'left', - h4('Upload Data'), - p('Upload data from a .json file.') - ), - column(4, align = 'right', - actionButton(inputId='uploadjson2', label="Demo", icon = icon("video-camera"), - onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=00m29s', '_blank')") - ) - ), - hr(), - - fluidRow( - column(12, align = 'center', - fileInput( - inputId = 'file3', - label = 'Choose file:', - accept = '.json' - ) - ) - ), - - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - - fluidRow( - - column(6, align = 'left', - actionButton(inputId='json2datasrc', label="Data Sources", icon = icon("long-arrow-left")) - ), - - column(6, align = 'right', - actionButton(inputId='json2datatrans', label="Data Selection", icon = icon("long-arrow-right")) - ) - - ) - - ) - - ), - tabPanel('STATA', value = 'tab_upload_stata', - - br(), - - fluidPage( - - fluidRow( - column(8, align = 'left', - h4('Upload Data'), - p('Upload data from a .dta file.') - ), - column(4, align = 'right', - actionButton(inputId='uploadstata2', label="Demo", icon = icon("video-camera"), - onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=00m29s', '_blank')") - ) - ), - hr(), - - fluidRow( - column(12, align = 'center', - fileInput( - inputId = 'file6', - label = 'Choose file:', - accept = '.dta' - ) - ) - ), - - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - - fluidRow( - - column(6, align = 'left', - actionButton(inputId='stata2datasrc', label="Data Sources", icon = icon("long-arrow-left")) - ), - - column(6, align = 'right', - actionButton(inputId='stata2datatrans', label="Data Selection", icon = icon("long-arrow-right")) - ) - - ) - - ) - - ), - tabPanel('SPSS', value = 'tab_upload_spss', - - br(), - - fluidPage( - - fluidRow( - column(8, align = 'left', - h4('Upload Data'), - p('Upload data from a .sav file.') - ), - column(4, align = 'right', - actionButton(inputId='uploadspss2', label="Demo", icon = icon("video-camera"), - onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=00m29s', '_blank')") - ) - ), - hr(), - - fluidRow( - column(12, align = 'center', - fileInput( - inputId = 'file5', - label = 'Choose file:', - accept = '.sav' - ) - ) - ), - - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - - fluidRow( - - column(6, align = 'left', - actionButton(inputId='spss2datasrc', label="Data Sources", icon = icon("long-arrow-left")) - ), - - column(6, align = 'right', - actionButton(inputId='spss2datatrans', label="Data Selection", icon = icon("long-arrow-right")) - ) - - ) - - ) - - ), - tabPanel('SAS', value = 'tab_upload_sas', - - br(), - - fluidPage( - - fluidRow( - column(8, align = 'left', - h4('Upload Data'), - p('Upload data from a .sas7bdat file.') - ), - column(4, align = 'right', - actionButton(inputId='uploadsas2', label="Demo", icon = icon("video-camera"), - onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=00m29s', '_blank')") - ) - ), - hr(), - - fluidRow( - column(12, align = 'center', - fileInput( - inputId = 'file4', - label = 'Choose file:', - accept = '.sas7bdat' - ) - ) - ), - - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - - fluidRow( - - column(6, align = 'left', - actionButton(inputId='sas2datasrc', label="Data Sources", icon = icon("long-arrow-left")) - ), - - column(6, align = 'right', - actionButton(inputId='sas2datatrans', label="Data Selection", icon = icon("long-arrow-right")) - ) - - ) - - ) - - ), - - tabPanel('RDS', value = 'tab_upload_rds', - - br(), - - fluidPage( - - fluidRow( - column(8, align = 'left', - h4('Upload Data'), - p('Upload data from a RDS file.') - ), - column(4, align = 'right', - actionButton(inputId='uploadrds2', label="Demo", icon = icon("video-camera"), - onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=00m29s', '_blank')") - ) - ), - hr(), - - fluidRow( - column(12, align = 'center', - fileInput( - inputId = 'file7', - label = 'Choose file:', - accept = '' - ) - ) - ), - - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - br(), - - fluidRow( - - column(6, align = 'left', - actionButton(inputId='rds2datasrc', label="Data Sources", icon = icon("long-arrow-left")) - ), - - column(6, align = 'right', - actionButton(inputId='rds2datatrans', label="Data Selection", icon = icon("long-arrow-right")) - ) - - ) - - ) - - ) - - ) - - ) - - ) - - ) - -) \ No newline at end of file + fluidPage( + + includeCSS("mystyle.css"), + + fluidRow( + + column(12, + + tabsetPanel(type = 'tabs', id = 'tabset_upload', + + tabPanel('CSV', value = 'tab_upload_csv', + + fluidPage( + + br(), + + fluidRow( + column(8, align = 'left', + h4('Upload Data'), + p('Upload data from a comma or tab separated file.') + ), + column(4, align = 'right', + actionButton(inputId='uploadlink2', label="Demo", icon = icon("video-camera"), + onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=00m29s', '_blank')") + ) + ), + hr(), + + fluidRow( + column(12, align = 'center', + fileInput('file1', 'Data Set:', + accept = c('text/csv', '.csv', + 'text/comma-separated-values,text/plain') + ) + ) + ), + + fluidRow( + column(12, align = 'center', checkboxInput('header', 'Header', TRUE)) + ), + + fluidRow( + column(12, align = 'center', + selectInput('sep', 'Separator', + choices = c('Comma' = ',', 'Semicolon' = ';', 'Tab' = '\t'), selected = ',') + ) + ), + + fluidRow( + column(12, align = 'center', + selectInput('quote', 'Quote', + choices = c('None' = '', 'Double Quote' = '"', 'Single Quote' = "'"), selected = '') + ) + ), + + br(), + br(), + br(), + + fluidRow( + + column(6, align = 'left', + actionButton(inputId = 'csv2datasrc', label = "Data Sources", icon = icon("long-arrow-left")) + ), + + column(6, align = 'right', + actionButton(inputId = 'csv2datatrans', label = "Data Selection", icon = icon("long-arrow-right")) + ) + + ) + + ) + + ), + tabPanel('Excel', value = 'tab_upload_excel', + + fluidPage( + + br(), + + fluidRow( + column(8, align = 'left', + h4('Upload Data'), + p('Upload data from a .xls or .xlsx file.') + ), + column(4, align = 'right', + actionButton(inputId = 'uploadexcel2', label = "Demo", icon = icon("video-camera"), + onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=00m29s', '_blank')") + ) + ), + hr(), + + fluidRow( + column(12, align = 'center', + fileInput( + inputId = 'file2', + label = 'Choose file:', + accept = c('.xls', '.xlsx') + ) + ) + ), + + fluidRow( + column(12, align = 'center', + numericInput( + inputId = 'sheet_n', + label = 'Sheet', + value = 1, + min = 1, + step = 1, + width = '120px' + ) + ) + ), + + br(), + br(), + + br(), + br(), + + br(), + br(), + br(), + br(), + br(), + + fluidRow( + + column(6, align = 'left', + actionButton(inputId = 'excel2datasrc', label = "Data Sources", icon = icon("long-arrow-left")) + ), + + column(6, align = 'right', + actionButton(inputId = 'excel2datatrans', label = "Data Selection", icon = icon("long-arrow-right")) + ) + + ) + + ) + + ) + ) + + ) + + ) + + ) + +) diff --git a/inst/app-visualize/ui/ui_dataoptions.R b/inst/app-visualize/ui/ui_dataoptions.R index d4d072d..62e0c8a 100644 --- a/inst/app-visualize/ui/ui_dataoptions.R +++ b/inst/app-visualize/ui/ui_dataoptions.R @@ -1,6 +1,6 @@ tabPanel('Data Sources', value = 'tab_datasources', - fluidPage(theme = shinytheme('cerulean'), + fluidPage( includeCSS("mystyle.css"), @@ -48,4 +48,4 @@ tabPanel('Data Sources', value = 'tab_datasources', ) -) \ No newline at end of file +) diff --git a/inst/app-visualize/ui/ui_hist_prh.R b/inst/app-visualize/ui/ui_hist_prh.R index 3339327..97ce501 100644 --- a/inst/app-visualize/ui/ui_hist_prh.R +++ b/inst/app-visualize/ui/ui_hist_prh.R @@ -55,49 +55,6 @@ tabPanel('Histogram', value = 'tab_hist_prh', ) ), - tabPanel('rbokeh', - - fluidRow( - column(2, - selectInput('bohist_select_x', 'Variable 1: ', - choices = "", selected = ""), - textInput(inputId = "bohist_xlabel", label = "X Axes Label: ", - value = "label"), - numericInput(inputId = "bohist_breaks", "Breaks: ", - value = 5, min = 0, step = 1), - selectInput(inputId = "bohist_lowest", label = "Include Lowest: ", - choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE"), - textInput(inputId = "bohist_color", label = "Color: ", - value = ""), - textInput(inputId = "bohist_dcolor", label = "Density Color: ", - value = ""), - numericInput(inputId = "bohist_dalpha", "Density Alpha: ", - value = 1, min = 0, max = 1, step = 0.1) - ), - - column(2, - textInput(inputId = "bohist_title", label = "Title: ", - value = "title"), - textInput(inputId = "bohist_ylabel", label = "Y Axes Label: ", - value = "label"), - selectInput(inputId = "bohist_density", label = "Density: ", - choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), - selectInput(inputId = "bohist_right", label = "Right: ", - choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE"), - selectInput(inputId = "bohist_add", label = "Add Density Line: ", - choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), - numericInput(inputId = "bohist_dtype", "Line Type: ", - value = 1, min = 1, max = 5, step = 1), - numericInput(inputId = "bohist_dwidth", "Line Width: ", - value = 1, min = 1, step = 1) - ), - - column(8, align = 'center', - rbokeh::rbokehOutput('bohist_plot_1', height = '600px') - ) - ) - ), - tabPanel('highcharts', fluidRow( @@ -125,4 +82,4 @@ tabPanel('Histogram', value = 'tab_hist_prh', ) ) ) -) \ No newline at end of file +) diff --git a/inst/app-visualize/ui/ui_line_prh.R b/inst/app-visualize/ui/ui_line_prh.R index 03c9234..9200bca 100644 --- a/inst/app-visualize/ui/ui_line_prh.R +++ b/inst/app-visualize/ui/ui_line_prh.R @@ -44,39 +44,6 @@ tabPanel('Line Chart', value = 'tab_line_prh', ) ), - tabPanel('rbokeh', - - fluidRow( - column(2, - selectInput('boline_select_x', 'X Axis: ', - choices = "", selected = ""), - numericInput(inputId = "boline_type", label = "Line Type: ", - min = 1, max = 5, value = 1, step = 1), - numericInput(inputId = "boline_alpha", label = "Alpha: ", - min = 0, max = 1, value = 1, step = 0.1), - textInput(inputId = "boline_xlabel", label = "X Axes Label: ", - value = "label"), - textInput(inputId = "boline_title", label = "Title: ", - value = "title") - ), - - column(2, - selectInput('boline_select_y', 'Y Axis: ', - choices = "", selected = ""), - textInput(inputId = "boline_color", label = "Color: ", - value = "blue"), - numericInput(inputId = "boline_width", label = "Line Width: ", - min = 0, value = 1, step = 0.1), - textInput(inputId = "boline_ylabel", label = "Y Axes Label: ", - value = "label") - ), - - column(8, align = 'center', - rbokeh::rbokehOutput('boline_plot_1', height = '600px') - ) - ) - ), - tabPanel('highcharts', fluidRow( @@ -108,4 +75,4 @@ tabPanel('Line Chart', value = 'tab_line_prh', ) ) ) -) \ No newline at end of file +) diff --git a/inst/app-visualize/ui/ui_scatter_prh.R b/inst/app-visualize/ui/ui_scatter_prh.R index 5a26972..891462c 100644 --- a/inst/app-visualize/ui/ui_scatter_prh.R +++ b/inst/app-visualize/ui/ui_scatter_prh.R @@ -57,70 +57,6 @@ tabPanel('Scatter Plot', value = 'tab_scatter_prh', ) ), - tabPanel('rbokeh', - - fluidRow( - column(4, - fluidRow( - column(6, - selectInput('boscat_select_x', 'Variable X: ', - choices = "", selected = ""), - numericInput(inputId = 'boscat_shape', 'Shape: ', - min = 0, max = 25, value = 22, step = 1), - textInput(inputId = "boscat_color", label = "Color: ", - value = ""), - selectInput('boscat_xgrid', 'X Axis Grid: ', - choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE"), - textInput(inputId = "boscat_xlabel", label = "X Axes Label: ", - value = "label"), - textInput(inputId = "boscat_title", label = "Title: ", - value = "title") - ), - - column(6, - selectInput('boscat_select_y', 'Variable Y: ', - choices = "", selected = ""), - numericInput(inputId = 'boscat_size', 'Size: ', - min = 0, value = 5, step = 1), - numericInput(inputId = 'boscat_alpha', 'Alpha: ', - min = 0, max = 1, value = 1, step = 0.1), - selectInput('boscat_ygrid', 'Y Axis Grid: ', - choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE"), - textInput(inputId = "boscat_ylabel", label = "Y Axes Label: ", - value = "label"), - selectInput('boscat_fitline', 'Fit Line: ', - choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") - ) - ), - - fluidRow(column(12, h5('Fit Line'))), - - fluidRow( - column(6, - numericInput(inputId = 'boscat_fint', 'Intercept: ', - value = 0, step = 1), - textInput(inputId = "boscat_lcolor", label = "Color: ", - value = ""), - numericInput(inputId = 'boscat_lwidth', 'Width: ', - min = 0, value = 1, step = 0.1) - ), - column(6, - numericInput(inputId = 'boscat_fslope', 'Slope: ', - value = 0, step = 1), - numericInput(inputId = 'boscat_lalpha', 'Alpha: ', - min = 0, max = 1, value = 1, step = 0.1), - numericInput(inputId = 'boscat_ltype', 'Type: ', - min = 1, value = 1, max = 5, step = 1) - ) - ) - ), - - column(8, align = 'center', - rbokeh::rbokehOutput('boscat_plot_1', height = '600px') - ) - ) - ), - tabPanel('highcharts', fluidRow( column(2, @@ -162,4 +98,4 @@ tabPanel('Scatter Plot', value = 'tab_scatter_prh', ) ) ) -) \ No newline at end of file +) diff --git a/inst/app-visualize/ui/ui_view.R b/inst/app-visualize/ui/ui_view.R index c830a98..4cbc08c 100644 --- a/inst/app-visualize/ui/ui_view.R +++ b/inst/app-visualize/ui/ui_view.R @@ -15,7 +15,7 @@ tabPanel('View', value = 'tab_view', hr(), fluidRow( - dataTableOutput(outputId = "table") + DTOutput(outputId = "table") ) ) ) diff --git a/inst/app-visualize/ui/ui_vizhome.R b/inst/app-visualize/ui/ui_vizhome.R index 81b3757..128d595 100644 --- a/inst/app-visualize/ui/ui_vizhome.R +++ b/inst/app-visualize/ui/ui_vizhome.R @@ -57,11 +57,10 @@ tabPanel("Home", value = "tab_home_viz", column(1), column(2, align = 'right', img(src = 'highcharts_logo.png', width = '40px', height = '40px'), - img(src = 'bokeh_logo.png', width = '40px', height = '40px'), img(src = 'plotly_logo.png', width = '40px', height = '40px') ), column(6, align = 'center', - h5("Visualize data using plotly, rbokeh or highcharts") + h5("Visualize data using plotly or highcharts") ), column(2, align = 'left', actionButton(inputId = "click_prh", diff --git a/man/app_rfm_analysis.Rd b/man/app_rfm_analysis.Rd index 76c1ff4..3d17e79 100644 --- a/man/app_rfm_analysis.Rd +++ b/man/app_rfm_analysis.Rd @@ -7,7 +7,7 @@ app_rfm_analysis() } \description{ -Launches the RFM analyssi app. +Launches the RFM analysis app. } \examples{ \dontrun{ diff --git a/man/app_vistributions.Rd b/man/app_vistributions.Rd index 07adb3c..99a9e83 100644 --- a/man/app_vistributions.Rd +++ b/man/app_vistributions.Rd @@ -11,6 +11,6 @@ Launches app for visualizing probability distributions. } \examples{ \dontrun{ -app_descriptive() +app_vistributions() } } diff --git a/man/xplorerr.Rd b/man/xplorerr.Rd index 3c38b8d..3b940ea 100644 --- a/man/xplorerr.Rd +++ b/man/xplorerr.Rd @@ -3,6 +3,7 @@ \docType{package} \name{xplorerr} \alias{xplorerr} +\alias{xplorerr-package} \title{\code{xplorerr} package} \description{ R Shiny app for interactive statistical analysis @@ -11,3 +12,17 @@ R Shiny app for interactive statistical analysis See the README on \href{https://github.com/rsquaredacademy/xplorerr}{GitHub} } +\seealso{ +Useful links: +\itemize{ + \item \url{https://github.com/rsquaredacademy/xplorerr} + \item \url{https://xplorerr.rsquaredacademy.com/} + \item Report bugs at \url{https://github.com/rsquaredacademy/xplorerr/issues} +} + +} +\author{ +\strong{Maintainer}: Aravind Hebbali \email{hebbali.aravind@gmail.com} (\href{https://orcid.org/0000-0001-9220-9669}{ORCID}) + +} +\keyword{internal} diff --git a/src-i386/RcppExports.cpp b/src-i386/RcppExports.cpp deleted file mode 100644 index a81d419..0000000 --- a/src-i386/RcppExports.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// Generated by using Rcpp::compileAttributes() -> do not edit by hand -// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 - -#include - -using namespace Rcpp; - -// xpl_nsignC -double xpl_nsignC(NumericVector x); -RcppExport SEXP _xplorerr_xpl_nsignC(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(xpl_nsignC(x)); - return rcpp_result_gen; -END_RCPP -} -// xpl_gvar -List xpl_gvar(NumericVector ln, NumericVector ly); -RcppExport SEXP _xplorerr_xpl_gvar(SEXP lnSEXP, SEXP lySEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type ln(lnSEXP); - Rcpp::traits::input_parameter< NumericVector >::type ly(lySEXP); - rcpp_result_gen = Rcpp::wrap(xpl_gvar(ln, ly)); - return rcpp_result_gen; -END_RCPP -} - -static const R_CallMethodDef CallEntries[] = { - {"_xplorerr_xpl_nsignC", (DL_FUNC) &_xplorerr_xpl_nsignC, 1}, - {"_xplorerr_xpl_gvar", (DL_FUNC) &_xplorerr_xpl_gvar, 2}, - {NULL, NULL, 0} -}; - -RcppExport void R_init_xplorerr(DllInfo *dll) { - R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); - R_useDynamicSymbols(dll, FALSE); -} diff --git a/src-i386/RcppExports.o b/src-i386/RcppExports.o deleted file mode 100644 index 8f1ddf6..0000000 Binary files a/src-i386/RcppExports.o and /dev/null differ diff --git a/src-i386/xpl-nsign.cpp b/src-i386/xpl-nsign.cpp deleted file mode 100644 index 702537b..0000000 --- a/src-i386/xpl-nsign.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include -using namespace Rcpp; - -//' Return sign -//' -//' @param x A numeric vector -//' @export -// [[Rcpp::export]] -double xpl_nsignC(NumericVector x) { - - int n = x.size(); - int count = 1; - - for(int i = 1; i < n; i++) { - int l = i - 1; - if(x[i] != x[l]) { - count++; - } - } - - return count; -} - - - - diff --git a/src-i386/xpl-nsign.o b/src-i386/xpl-nsign.o deleted file mode 100644 index 2d647f1..0000000 Binary files a/src-i386/xpl-nsign.o and /dev/null differ diff --git a/src-i386/xpl-tvar.cpp b/src-i386/xpl-tvar.cpp deleted file mode 100644 index 6063f9a..0000000 --- a/src-i386/xpl-tvar.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include -using namespace Rcpp; - -//' Repeat data -//' -//' @param ln A list -//' @param ly A list -//' @export -// [[Rcpp::export]] -List xpl_gvar(NumericVector ln, NumericVector ly) { - - int n = ly.size(); - List out(n); - - for(int i = 0; i < n; i++) { - out[i] = rep(i, ln[i]); - } - - return out; - -} - diff --git a/src-i386/xpl-tvar.o b/src-i386/xpl-tvar.o deleted file mode 100644 index 7410431..0000000 Binary files a/src-i386/xpl-tvar.o and /dev/null differ diff --git a/src-i386/xplorerr.dll b/src-i386/xplorerr.dll deleted file mode 100644 index a92f2f9..0000000 Binary files a/src-i386/xplorerr.dll and /dev/null differ diff --git a/src-x64/RcppExports.cpp b/src-x64/RcppExports.cpp deleted file mode 100644 index a81d419..0000000 --- a/src-x64/RcppExports.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// Generated by using Rcpp::compileAttributes() -> do not edit by hand -// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 - -#include - -using namespace Rcpp; - -// xpl_nsignC -double xpl_nsignC(NumericVector x); -RcppExport SEXP _xplorerr_xpl_nsignC(SEXP xSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); - rcpp_result_gen = Rcpp::wrap(xpl_nsignC(x)); - return rcpp_result_gen; -END_RCPP -} -// xpl_gvar -List xpl_gvar(NumericVector ln, NumericVector ly); -RcppExport SEXP _xplorerr_xpl_gvar(SEXP lnSEXP, SEXP lySEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< NumericVector >::type ln(lnSEXP); - Rcpp::traits::input_parameter< NumericVector >::type ly(lySEXP); - rcpp_result_gen = Rcpp::wrap(xpl_gvar(ln, ly)); - return rcpp_result_gen; -END_RCPP -} - -static const R_CallMethodDef CallEntries[] = { - {"_xplorerr_xpl_nsignC", (DL_FUNC) &_xplorerr_xpl_nsignC, 1}, - {"_xplorerr_xpl_gvar", (DL_FUNC) &_xplorerr_xpl_gvar, 2}, - {NULL, NULL, 0} -}; - -RcppExport void R_init_xplorerr(DllInfo *dll) { - R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); - R_useDynamicSymbols(dll, FALSE); -} diff --git a/src-x64/RcppExports.o b/src-x64/RcppExports.o deleted file mode 100644 index 8f1ddf6..0000000 Binary files a/src-x64/RcppExports.o and /dev/null differ diff --git a/src-x64/xpl-nsign.cpp b/src-x64/xpl-nsign.cpp deleted file mode 100644 index 702537b..0000000 --- a/src-x64/xpl-nsign.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include -using namespace Rcpp; - -//' Return sign -//' -//' @param x A numeric vector -//' @export -// [[Rcpp::export]] -double xpl_nsignC(NumericVector x) { - - int n = x.size(); - int count = 1; - - for(int i = 1; i < n; i++) { - int l = i - 1; - if(x[i] != x[l]) { - count++; - } - } - - return count; -} - - - - diff --git a/src-x64/xpl-nsign.o b/src-x64/xpl-nsign.o deleted file mode 100644 index 2d647f1..0000000 Binary files a/src-x64/xpl-nsign.o and /dev/null differ diff --git a/src-x64/xpl-tvar.cpp b/src-x64/xpl-tvar.cpp deleted file mode 100644 index 6063f9a..0000000 --- a/src-x64/xpl-tvar.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include -using namespace Rcpp; - -//' Repeat data -//' -//' @param ln A list -//' @param ly A list -//' @export -// [[Rcpp::export]] -List xpl_gvar(NumericVector ln, NumericVector ly) { - - int n = ly.size(); - List out(n); - - for(int i = 0; i < n; i++) { - out[i] = rep(i, ln[i]); - } - - return out; - -} - diff --git a/src-x64/xpl-tvar.o b/src-x64/xpl-tvar.o deleted file mode 100644 index 7410431..0000000 Binary files a/src-x64/xpl-tvar.o and /dev/null differ diff --git a/src-x64/xplorerr.dll b/src-x64/xplorerr.dll deleted file mode 100644 index a92f2f9..0000000 Binary files a/src-x64/xplorerr.dll and /dev/null differ diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index a81d419..377d4f1 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -5,6 +5,11 @@ using namespace Rcpp; +#ifdef RCPP_USE_GLOBAL_ROSTREAM +Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); +Rcpp::Rostream& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(); +#endif + // xpl_nsignC double xpl_nsignC(NumericVector x); RcppExport SEXP _xplorerr_xpl_nsignC(SEXP xSEXP) {