Skip to content

Commit

Permalink
Merge pull request #35 from RhoInc/v1.0_fixes
Browse files Browse the repository at this point in the history
V1.0 fixes
  • Loading branch information
Becca Krouse authored Aug 30, 2018
2 parents 983d4d1 + a34795e commit bfe585a
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
^.*\.Rproj$
^\.Rproj\.user$
^README\.md$
^\.travis\.yml$
^cran-comments\.md$
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r

language: R
sudo: false
cache: packages

os:
- linux
- osx

8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: datadigest
Type: Package
Title: Create an Interactive Codebook from R
Version: 1.0
Title: Create an Interactive Data Summary from R
Version: 1.0.1
Authors@R: c(
person("Becca", "Krouse", email = "rebecca_krouse@rhoworld.com", role = c("cre","aut")),
person("Spencer", "Childress", role = c("aut")),
Expand All @@ -11,9 +11,9 @@ Description: An R interface for Rho's web-codebook JavaScript charting library,
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.0.1
RoxygenNote: 6.1.0
Depends:
R (>= 3.3.3)
R (>= 3.3.0)
Imports: htmlwidgets,
shiny,
miniUI,
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# datadigest 1.0.1

Initial release for datadigest, an R interface for Rho's [web-codebook](https://github.com/RhoInc/web-codebook) JavaScript library. The r version of the codebook has been built using the [htmlwidgets](htmlwidgets.org) framework and consists of two key functions: ```codebook()``` and ```explorer()```. ```codebook()``` delivers an interactive interface for a single data frame while ```explorer()``` extends this functionality, allowing the user to navigate through multiple data frames.

While ```codebook()``` and ```explorer()``` can be loaded as HTML widgets using their respective R functions, the package also includes a dedicated Shiny application for each. The shiny applications offer easy access to data currently loaded in the R session, the ability to upload data files, and/or the ability to download a static or interactive data summary. Following package installation, RStudio users may access the two applications via the toolbar as RStudio add-ins.
2 changes: 1 addition & 1 deletion R/codebook.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' }
#'
#' @examples
#' codebook(data=mtcars)
#' codebook(data = mtcars)
#'
#' @import htmlwidgets
#' @importFrom tibble is_tibble
Expand Down
26 changes: 12 additions & 14 deletions R/explorer.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#' @import datasets
#'
#' @export
explorer <- function(data = NULL, addEnv=TRUE, demo=FALSE) {
explorer <- function(data = NULL, addEnv = TRUE, demo = FALSE) {

# get names of files in dataList as text string
if (is.list(data)){
Expand Down Expand Up @@ -72,9 +72,7 @@ explorer <- function(data = NULL, addEnv=TRUE, demo=FALSE) {
df <- fileList[[i]]
df <- as.data.frame(df)
for (j in 1:ncol(df)){
# if (is.factor(df[,j])){
df[,j] <- as.character(df[,j])
# }
}
df[is.na(df)] <- ""
fileList_formatted[[i]] <- list(
Expand All @@ -89,9 +87,7 @@ explorer <- function(data = NULL, addEnv=TRUE, demo=FALSE) {
df <- get(fileList[i])
df <- as.data.frame(df)
for (j in 1:ncol(df)){
# if (is.factor(df[,j])){
df[,j] <- as.character(df[,j])
# }
}
df[is.na(df)] <- ""
fileList_formatted[[i]] <- list(
Expand All @@ -112,7 +108,15 @@ explorer <- function(data = NULL, addEnv=TRUE, demo=FALSE) {
rSettings[["settings"]][["files"]] = c(rSettings[["settings"]][["files"]], data_list_formatted)
}

# (3) Prep an array of objects for the environment files (if addEnv=T)
# (3) load 20 datasets and put them in the environment (if demo=T)
if(demo){
addEnv <- FALSE # force addEnv to be false
demo_list = ls("package:datasets")[sapply(ls("package:datasets"), function(x) inherits(get(x), "data.frame"))]
demo_list_formatted <- formatFileList(demo_list)
rSettings[["settings"]][["files"]] = demo_list_formatted #ignores other settings
}

# (4) Prep an array of objects for the environment files (if addEnv=T)
if(addEnv){
if(length(ls(pos=1))>0){
env_list <- ls(pos=1)[sapply(ls(pos=1), function(x) inherits(get(x), "data.frame"))]
Expand All @@ -133,14 +137,8 @@ explorer <- function(data = NULL, addEnv=TRUE, demo=FALSE) {

}

# (4) load 20 datasets and put them in the environment (if demo=T)
if(demo){
demo_list = ls("package:datasets")[sapply(ls("package:datasets"), function(x) inherits(get(x), "data.frame"))]
demo_list_formatted <- formatFileList(demo_list)
rSettings[["settings"]][["files"]] = demo_list_formatted #ignores other settings
}

# (4) create widget

# (5) create widget
htmlwidgets::createWidget(
name = 'explorer',
rSettings,
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Travis-CI Build Status](https://travis-ci.org/RhoInc/datadigest.svg?branch=master)](https://travis-ci.org/RhoInc/datadigest)

# Data Digest

The **datadigest** package provides a simple interactive framework for exploring data. You can:
Expand Down
17 changes: 17 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Version 1.0.1
This is the first submission of datadigest.

## Test environments
* ubuntu 14.04, R 3.5.0 (on travis-ci)
* Mac osx 10.13.3, R 3.5.0 (on travis-ci)
* win-builder (devel)

## R CMD check results
There were no ERRORs or WARNINGs.

There was 1 NOTE:

* checking CRAN incoming feasibility ... NOTE
Maintainer: 'Becca Krouse <rebecca_krouse@rhoworld.com>'

New submission
2 changes: 1 addition & 1 deletion man/codebook.Rd

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

4 changes: 2 additions & 2 deletions vignettes/datadigest.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ The **datadigest** package provides a simple interactive framework for exploring

## Background

The codebook tool was developed to aid in the exploration of clinical trial data. Any given trial requires vigorous monitoring and exploration of the incoming data. These technical tasks are imperative for ensuring data quality and proper interpretation of study results. The interactive codebook was designed to streamline data exploration for any data set.
The interactive codebook tool was developed to aid in the exploration of clinical trial data. Any given trial requires vigorous monitoring and exploration of the incoming data. These technical tasks are imperative for ensuring data quality and proper interpretation of study results. The interactive codebook was designed to streamline data exploration for any data set.

The interactive codebook builds upon the existing use of statistical graphics and data visualization in clinical trials by creating a simple interactive framework for exploring data. In particular, codebook takes inspiration from Frank Harrell's excellent `describe` method from the ```Hmisc``` R package to create concise summaries of every variable in a dataset with minimal user configuration. Like its static codebook predecessors, the web-codebook includes paneled displays, comprehensive data listings, and charts for each variable type, but it expands on these tools by providing interactivity via dynamic filters, collapsible/expandable sections, across-chart data linking, and customizable controls. The resulting tool is well suited for use in many aspects of clinical trial research, including data exploration, anomaly detection, key end point and safety monitoring surveillance.

## R package
The **datadigest** package consists of two key functions: ```codebook()``` and ```explorer()```. ```codebook()``` delivers an interactive interface for a single data frame. ```explorer()``` extends this functionality, allowing the user to navigate through multiple data frames. While ```codebook()``` and ```explorer()``` can be loaded as HTML widgets using their respective R functions, the package also includes a dedicated Shiny application for each. The shiny applications offer easy access to data currently loaded in the R session, the ability to upload data files, and/or the ability to download a static or interactive data summary. Following package installation, RStudio users may access the two applications via the toolbar as RStudio add-ins.
The **datadigest** package provides an interface for the interactive codebook tool. **datadigest** consists of two key functions: ```codebook()``` and ```explorer()```. ```codebook()``` delivers an interactive interface for a single data frame. ```explorer()``` extends this functionality, allowing the user to navigate through multiple data frames. While ```codebook()``` and ```explorer()``` can be loaded as HTML widgets using their respective R functions, the package also includes a dedicated Shiny application for each. The shiny applications offer easy access to data currently loaded in the R session, the ability to upload data files, and/or the ability to download a static or interactive data summary. Following package installation, RStudio users may access the two applications via the toolbar as RStudio add-ins.

## Codebook/explorer data summaries
Together, the codebook and explorer tools have 5 views that share interactive functionality:
Expand Down

0 comments on commit bfe585a

Please sign in to comment.