diff --git a/DESCRIPTION b/DESCRIPTION index 976a94d..69ced4e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: IMposterior +Package: IMPosterior Title: Plot the posterior distribution Version: 0.5 Authors@R: c( diff --git a/NAMESPACE b/NAMESPACE index 562f66f..bccdb44 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,7 +1,7 @@ # Generated by roxygen2: do not edit by hand -export(IMposterior) -export(IMposteriorOutput) -export(renderIMposterior) +export(IMPosterior) +export(IMPosteriorOutput) +export(renderIMPosterior) import(htmlwidgets) importFrom(magrittr,"%>%") diff --git a/R/IMposterior.R b/R/IMPosterior.R similarity index 82% rename from R/IMposterior.R rename to R/IMPosterior.R index 7a096d0..60acf81 100644 --- a/R/IMposterior.R +++ b/R/IMPosterior.R @@ -6,7 +6,7 @@ #' @importFrom magrittr "%>%" #' #' @export -IMposterior <- function(x, MME = 0, threshold = 0.75, colors, +IMPosterior <- function(x, MME = 0, threshold = 0.75, colors, width = NULL, height = NULL, elementId = NULL) { # Set colors @@ -71,39 +71,39 @@ IMposterior <- function(x, MME = 0, threshold = 0.75, colors, # create widget htmlwidgets::createWidget( - name = 'IMposterior', + name = 'IMPosterior', opts, width = width, height = height, - package = 'IMposterior', + package = 'IMPosterior', elementId = elementId ) } -#' Shiny bindings for IMposterior +#' Shiny bindings for IMPosterior #' -#' Output and render functions for using IMposterior within Shiny +#' Output and render functions for using IMPosterior within Shiny #' applications and interactive Rmd documents. #' #' @param outputId output variable to read from #' @param width,height Must be a valid CSS unit (like \code{'100\%'}, #' \code{'400px'}, \code{'auto'}) or a number, which will be coerced to a #' string and have \code{'px'} appended. -#' @param expr An expression that generates a IMposterior +#' @param expr An expression that generates a IMPosterior #' @param env The environment in which to evaluate \code{expr}. #' @param quoted Is \code{expr} a quoted expression (with \code{quote()})? This #' is useful if you want to save an expression in a variable. #' -#' @name IMposterior-shiny +#' @name IMPosterior-shiny #' #' @export -IMposteriorOutput <- function(outputId, width = '100%', height = '400px'){ - htmlwidgets::shinyWidgetOutput(outputId, 'IMposterior', width, height, package = 'IMposterior') +IMPosteriorOutput <- function(outputId, width = '100%', height = '400px'){ + htmlwidgets::shinyWidgetOutput(outputId, 'IMPosterior', width, height, package = 'IMPosterior') } -#' @rdname IMposterior-shiny +#' @rdname IMPosterior-shiny #' @export -renderIMposterior <- function(expr, env = parent.frame(), quoted = FALSE) { +renderIMPosterior <- function(expr, env = parent.frame(), quoted = FALSE) { if (!quoted) { expr <- substitute(expr) } # force quoted - htmlwidgets::shinyRenderWidget(expr, IMposteriorOutput, env, quoted = TRUE) + htmlwidgets::shinyRenderWidget(expr, IMPosteriorOutput, env, quoted = TRUE) } diff --git a/inst/htmlwidgets/IMposterior.js b/inst/htmlwidgets/IMPosterior.js similarity index 99% rename from inst/htmlwidgets/IMposterior.js rename to inst/htmlwidgets/IMPosterior.js index d59314c..e42be01 100644 --- a/inst/htmlwidgets/IMposterior.js +++ b/inst/htmlwidgets/IMPosterior.js @@ -1,6 +1,6 @@ HTMLWidgets.widget({ - name: 'IMposterior', + name: 'IMPosterior', type: 'output', diff --git a/inst/htmlwidgets/IMposterior.yaml b/inst/htmlwidgets/IMPosterior.yaml similarity index 100% rename from inst/htmlwidgets/IMposterior.yaml rename to inst/htmlwidgets/IMPosterior.yaml diff --git a/man/IMposterior-shiny.Rd b/man/IMPosterior-shiny.Rd similarity index 56% rename from man/IMposterior-shiny.Rd rename to man/IMPosterior-shiny.Rd index bf399ff..80267d6 100644 --- a/man/IMposterior-shiny.Rd +++ b/man/IMPosterior-shiny.Rd @@ -1,14 +1,14 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/IMposterior.R -\name{IMposterior-shiny} -\alias{IMposterior-shiny} -\alias{IMposteriorOutput} -\alias{renderIMposterior} -\title{Shiny bindings for IMposterior} +% Please edit documentation in R/IMPosterior.R +\name{IMPosterior-shiny} +\alias{IMPosterior-shiny} +\alias{IMPosteriorOutput} +\alias{renderIMPosterior} +\title{Shiny bindings for IMPosterior} \usage{ -IMposteriorOutput(outputId, width = "100\%", height = "400px") +IMPosteriorOutput(outputId, width = "100\%", height = "400px") -renderIMposterior(expr, env = parent.frame(), quoted = FALSE) +renderIMPosterior(expr, env = parent.frame(), quoted = FALSE) } \arguments{ \item{outputId}{output variable to read from} @@ -17,7 +17,7 @@ renderIMposterior(expr, env = parent.frame(), quoted = FALSE) \code{'400px'}, \code{'auto'}) or a number, which will be coerced to a string and have \code{'px'} appended.} -\item{expr}{An expression that generates a IMposterior} +\item{expr}{An expression that generates a IMPosterior} \item{env}{The environment in which to evaluate \code{expr}.} @@ -25,6 +25,6 @@ string and have \code{'px'} appended.} is useful if you want to save an expression in a variable.} } \description{ -Output and render functions for using IMposterior within Shiny +Output and render functions for using IMPosterior within Shiny applications and interactive Rmd documents. } diff --git a/man/IMPosterior.Rd b/man/IMPosterior.Rd new file mode 100644 index 0000000..b18651e --- /dev/null +++ b/man/IMPosterior.Rd @@ -0,0 +1,12 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/IMPosterior.R +\name{IMPosterior} +\alias{IMPosterior} +\title{} +\usage{ +IMPosterior(x, MME = 0, threshold = 0.75, colors, width = NULL, + height = NULL, elementId = NULL) +} +\description{ + +} diff --git a/man/IMposterior.Rd b/man/IMposterior.Rd deleted file mode 100644 index 381ab9d..0000000 --- a/man/IMposterior.Rd +++ /dev/null @@ -1,12 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/IMposterior.R -\name{IMposterior} -\alias{IMposterior} -\title{} -\usage{ -IMposterior(x, MME = 0, threshold = 0.75, colors, width = NULL, - height = NULL, elementId = NULL) -} -\description{ - -} diff --git a/tests/example.R b/tests/example.R index f006a44..e000a27 100644 --- a/tests/example.R +++ b/tests/example.R @@ -4,8 +4,8 @@ x <- rnorm(1000) # Usy my widget ----------------------------------------------------------- -library(IMposterior) -IMposterior(x= x, MME=1) +library(IMPosterior) +IMPosterior(x= x, MME=1)