From 3f207cd0908b7c33500095affb7f448a2c72ef1d Mon Sep 17 00:00:00 2001 From: Danielle Callan Date: Tue, 21 Nov 2023 21:54:46 -0500 Subject: [PATCH] first pass documentation --- NAMESPACE | 5 +++++ R/app.R | 8 +++++++- R/bipartiteNetworkWidget.R | 25 +++++++++++++++++++++++++ man/bipartiteNetwork.Rd | 20 ++++++++++++++++++++ man/bipartiteNetworkOutput.Rd | 16 ++++++++++++++++ man/corGraph.Rd | 11 +++++++++++ man/renderBipartiteNetwork.Rd | 19 +++++++++++++++++++ 7 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 man/bipartiteNetwork.Rd create mode 100644 man/bipartiteNetworkOutput.Rd create mode 100644 man/corGraph.Rd create mode 100644 man/renderBipartiteNetwork.Rd diff --git a/NAMESPACE b/NAMESPACE index 8ac541a..ac97e49 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,5 +1,8 @@ # Generated by roxygen2: do not edit by hand +export(bipartiteNetwork) +export(bipartiteNetworkOutput) +export(renderBipartiteNetwork) import(dplyr) import(ggplot2) import(htmlwidgets) @@ -8,6 +11,8 @@ importFrom(DT,DTOutput) importFrom(DT,renderDT) importFrom(bslib,bs_theme) importFrom(r2d3,html_dependencies_d3) +importFrom(shiny,export) +importFrom(shiny,shinyApp) importFrom(shinyjs,useShinyjs) importFrom(stats,rnorm) importFrom(utils,read.table) diff --git a/R/app.R b/R/app.R index cc27096..bd12623 100644 --- a/R/app.R +++ b/R/app.R @@ -1,3 +1,9 @@ +#' corGraph Shiny App +#' +#' Launches the corGraph Shiny App +#' +#' @importFrom shiny shinyApp +#' export corGraph <- function(...) { - shinyApp(ui, server, ...) + shiny::shinyApp(ui, server, ...) } \ No newline at end of file diff --git a/R/bipartiteNetworkWidget.R b/R/bipartiteNetworkWidget.R index deadf37..420d3a4 100644 --- a/R/bipartiteNetworkWidget.R +++ b/R/bipartiteNetworkWidget.R @@ -2,9 +2,18 @@ library(htmlwidgets) library(dplyr) library(r2d3) +#' bipartiteNetwork +#' +#' Create a bipartiteNetwork widget +#' +#' @param data a data frame with source, target, and value columns +#' @param width the width of the widget +#' @param height the height of the widget +#' @param elementId the ID of the widget #' @import htmlwidgets #' @importFrom r2d3 html_dependencies_d3 #' @import dplyr +#' @export bipartiteNetwork <- function(data, width = NULL, height = NULL, elementId = NULL) { if (!inherits(data, "data.frame") || !all(c("source", "target", "value") %in% names(data))) { stop("Data must be a data frame with source, target, and value columns.") @@ -26,10 +35,26 @@ bipartiteNetwork <- function(data, width = NULL, height = NULL, elementId = NULL ) } +#' Shiny bindings for bipartiteNetwork +#' +#' Output function for using bipartiteNetwork within Shiny apps +#' +#' @param outputId output variable to read from +#' @param width,height Must be a valid CSS unit (like \code{'100\%'}, '400px', or 'auto') +#' @export bipartiteNetworkOutput <- function(outputId, width = '100%', height = '400px'){ htmlwidgets::shinyWidgetOutput(outputId, 'bipartitenetwork', width, height, package = 'correlationMatrixAsNetwork') } +#' Shiny bindings for bipartiteNetwork +#' +#' Render function for using bipartiteNetwork within Shiny apps +#' +#' @param expr an expression that generates bipartiteNetwork +#' @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 +#' @export renderBipartiteNetwork <- function(expr, env = parent.frame(), quoted = FALSE) { if (!quoted) { expr <- substitute(expr) } htmlwidgets::shinyRenderWidget(expr, bipartiteNetworkOutput, env, quoted = TRUE) diff --git a/man/bipartiteNetwork.Rd b/man/bipartiteNetwork.Rd new file mode 100644 index 0000000..50993c4 --- /dev/null +++ b/man/bipartiteNetwork.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/bipartiteNetworkWidget.R +\name{bipartiteNetwork} +\alias{bipartiteNetwork} +\title{bipartiteNetwork} +\usage{ +bipartiteNetwork(data, width = NULL, height = NULL, elementId = NULL) +} +\arguments{ +\item{data}{a data frame with source, target, and value columns} + +\item{width}{the width of the widget} + +\item{height}{the height of the widget} + +\item{elementId}{the ID of the widget} +} +\description{ +Create a bipartiteNetwork widget +} diff --git a/man/bipartiteNetworkOutput.Rd b/man/bipartiteNetworkOutput.Rd new file mode 100644 index 0000000..77b55a5 --- /dev/null +++ b/man/bipartiteNetworkOutput.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/bipartiteNetworkWidget.R +\name{bipartiteNetworkOutput} +\alias{bipartiteNetworkOutput} +\title{Shiny bindings for bipartiteNetwork} +\usage{ +bipartiteNetworkOutput(outputId, width = "100\%", height = "400px") +} +\arguments{ +\item{outputId}{output variable to read from} + +\item{width, height}{Must be a valid CSS unit (like \code{'100\%'}, '400px', or 'auto')} +} +\description{ +Output function for using bipartiteNetwork within Shiny apps +} diff --git a/man/corGraph.Rd b/man/corGraph.Rd new file mode 100644 index 0000000..a021076 --- /dev/null +++ b/man/corGraph.Rd @@ -0,0 +1,11 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/app.R +\name{corGraph} +\alias{corGraph} +\title{corGraph Shiny App} +\usage{ +corGraph(...) +} +\description{ +Launches the corGraph Shiny App +} diff --git a/man/renderBipartiteNetwork.Rd b/man/renderBipartiteNetwork.Rd new file mode 100644 index 0000000..9f13b4e --- /dev/null +++ b/man/renderBipartiteNetwork.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/bipartiteNetworkWidget.R +\name{renderBipartiteNetwork} +\alias{renderBipartiteNetwork} +\title{Shiny bindings for bipartiteNetwork} +\usage{ +renderBipartiteNetwork(expr, env = parent.frame(), quoted = FALSE) +} +\arguments{ +\item{expr}{an expression that generates bipartiteNetwork} + +\item{env}{the environment in which to evaluate \code{expr}} + +\item{quoted}{Is \code{expr} a quoted expression (with \code{quote()})? This +is useful if you want to save an expression in a variable} +} +\description{ +Render function for using bipartiteNetwork within Shiny apps +}