shinyDataset: Load a dataset for a Shiny session

Description Usage Arguments Value Examples

Description

This function wraps crunch::loadDataset() in a shiny::reactive() object for use in a Shiny app. It also ensures that the current user is authenticated with Crunch before proceeding.

Usage

1

Arguments

...

Arguments passed to loadDataset

Value

A Shiny reactive object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
shinyServer(function(input, output, session) {
    ds <- shinyDataset("Your dataset name")

    freqs <- reactive({
        fmla <- as.formula(paste("~", input$varname))
        crtabs(fmla, data=ds())
    })
})

## End(Not run)

Example output

Loading required package: crunch

Attaching package: 'crunch'

The following object is masked from 'package:utils':

    write.csv

The following object is masked from 'package:base':

    table

Loading required package: shiny

Attaching package: 'shiny'

The following object is masked from 'package:crunch':

    icon

crunchy documentation built on Jan. 16, 2021, 5:17 p.m.