Skip to content

Commit

Permalink
Merge pull request #17 from rsquaredacademy/develop
Browse files Browse the repository at this point in the history
CRAN release
  • Loading branch information
aravindhebbali authored Mar 7, 2019
2 parents c3edfc4 + 6e07ce0 commit cb69259
Show file tree
Hide file tree
Showing 32 changed files with 1,341 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
language: r
cache: packages
dist: trusty
warnings_are_errors: true
warnings_are_errors: false
sudo: false

matrix:
Expand Down
12 changes: 8 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
Package: vistributions
Type: Package
Title: Visualize Probability Distributions
Version: 0.1.0.9000
Version: 0.1.1
Authors@R: person("Aravind", "Hebbali", email = "hebbali.aravind@gmail.com", role = c("aut", "cre"))
Description: Visualize and compute percentiles/probabilities of normal, t, f, chi square
and binomial distributions.
Depends:
R(>= 3.1)
Imports:
ggplot2,
magrittr,
shiny,
stats,
utils,
xplorerr
utils
Suggests:
testthat,
knitr,
rmarkdown
rmarkdown,
shinyBS,
shinycssloaders,
shinythemes
License: MIT + file LICENSE
URL: https://github.com/rsquaredacademy/vistributions, https://vistributions.rsquaredacademy.com
BugReports: https://github.com/rsquaredacademy/vistributions/issues
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export(vdist_normal_prob)
export(vdist_t_perc)
export(vdist_t_plot)
export(vdist_t_prob)
importFrom(magrittr,"%>%")
importFrom(utils,install.packages)
importFrom(utils,menu)
importFrom(utils,packageVersion)
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# vistributions 0.1.1

This is a patch release to fix bugs in the app.

# vistributions 0.1.0

* Added a `NEWS.md` file to track changes to the package.
7 changes: 2 additions & 5 deletions R/vdist-app.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#' @title Launch shiny app
#' @description Launches shiny app for interactive model building.
#' @description Launches shiny app for visualizing distributions.
#' @examples
#' \dontrun{
#' vdist_launch_app ()
Expand All @@ -8,13 +8,10 @@
#'
vdist_launch_app <- function() {

message("`vdist_launch_app ()` has been soft-deprecated and will be removed in the next release. In future, to launch the app, run the below code:\n
- install.packages('xplorerr')\n - xplorerr::app_vistributions()\n")

check_suggests('shinyBS')
check_suggests('shinycssloaders')
check_suggests('shinythemes')

xplorerr::app_vistributions()
shiny::runApp(appDir = system.file("application", package = "vistributions"))
}

17 changes: 12 additions & 5 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#' @importFrom magrittr %>%
.onAttach <- function(...) {

if (!interactive() || stats::runif(1) > 0.1) return()
Expand All @@ -6,7 +7,7 @@

cran_version <-
pkgs %>%
extract("vistributions", "Version") %>%
magrittr::extract("vistributions", "Version") %>%
package_version()

local_version <- utils::packageVersion("vistributions")
Expand All @@ -21,10 +22,16 @@

tip <- sample(tips, 1)

if (behind_cran) {
packageStartupMessage("A new version of vistributions (0.2.0) is available with bug fixes and new features.")
} else {
packageStartupMessage(paste(strwrap(tip), collapse = "\n"))
if (interactive()) {
if (behind_cran) {
msg <- "A new version of vistributions is available with bug fixes and new features."
packageStartupMessage(msg, "\nWould you like to install it?")
if (utils::menu(c("Yes", "No")) == 1) {
utils::update.packages("vistributions")
}
} else {
packageStartupMessage(paste(strwrap(tip), collapse = "\n"))
}
}

}
7 changes: 3 additions & 4 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
## Test environments
* local Windows 10 install, R 3.5.1
* ubuntu 14.04 (on travis-ci), R 3.5.1
* local Windows 10, R 3.5.2
* ubuntu 14.04 (on travis-ci), R 3.4.4, R 3.5.2, R devel
* win-builder (devel and release)

## R CMD check results

0 errors | 0 warnings | 1 note
0 errors | 0 warnings | 0 note

* This is a new release.
12 changes: 11 additions & 1 deletion docs/index.html

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

17 changes: 17 additions & 0 deletions inst/application/logic/logic_binom.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
output$binom_shape <- renderPlot({
vdist_binom_plot(input$binom_n, input$binom_p)
})

output$bprob_plot <- renderPlot({
if (input$bprob_tail != 'interval') {
vdist_binom_prob(input$bprob_n, input$bprob_p, input$bprob_s, input$bprob_tail)
} else {
vdist_binom_prob(input$bprob_n, input$bprob_p,
c(input$bprob_tail_1, input$bprob_tail_2), input$bprob_tail)
}

})

output$bperc_plot <- renderPlot({
vdist_binom_perc(input$bperc_n, input$bperc_p, input$bperc_tp, input$bperc_tail)
})
11 changes: 11 additions & 0 deletions inst/application/logic/logic_chisq.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
output$chisq_shape <- renderPlot({
vdist_chisquare_plot(input$chisq_df, as.logical(input$chisq_norm))
})

output$chiprob_plot <- renderPlot({
vdist_chisquare_prob(input$chiprob_p, input$chiprob_df, input$chiprob_tail)
})

output$chiperc_plot <- renderPlot({
print(vdist_chisquare_perc(input$chiperc_p, input$chiperc_df, input$chiperc_tail))
})
6 changes: 6 additions & 0 deletions inst/application/logic/logic_exit_button.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Exit ---------------------------------------------------------------
observe({
if (isTRUE(input$mainpage == "exit")) {
stopApp()
}
})
11 changes: 11 additions & 0 deletions inst/application/logic/logic_f.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
output$f_shape <- renderPlot({
vdist_f_plot(input$f_numdf, input$f_dendf, as.logical(input$f_norm))
})

output$fprob_plot <- renderPlot({
vdist_f_prob(input$fprob_p, input$fprob_numdf, input$fprob_dendf, input$fprob_tail)
})

output$fperc_plot <- renderPlot({
vdist_f_perc(input$fperc_p, input$fperc_numdf, input$fperc_dendf, input$fperc_tail)
})
Loading

0 comments on commit cb69259

Please sign in to comment.