Learn R Programming

teachingApps (version 1.0.8)

add_server: Add the server of one app to the server of another app

Description

Sources a server.R file before parsing and evaluating its contents in a specified environment

Usage

add_server(app, path, env = NULL)

Arguments

app

Name of the teachingApp from which the content of the server.R will be pulled

path

Path to a directory containing the app from which the content of the server.R will be pulled

env

Environment in which the call is made, typically environment()

Value

An Observer-class object resulting from evaluating a server.R file

Details

Currently, this function can be used to insert an server into a navbarPage app. The types of apps that can be inserted are:

  • fluidPage

  • bootstrapPage

  • pageWithSidebar

  • basicPage

  • fixedPage

A server can be added as an entire tabPanel or as a row within within a tabPanel portion of a shiny app.

May be used with apps stored in packages other than teachingApps. However, apps are assumed be stored in the apps/ directory located at top level of the package.

See Also

add_ui, add_rmd

Examples

Run this code
# NOT RUN {
## server.R from app: 'maximum_likelihood'

server_ml <- system.file('apps', 
                         'maximum_likelihood',
                         'server.R',
                         package = 'teachingApps') 
browseURL(server_ml)

## server.R from app: 'distribution_weibull'

server_dw <- system.file('apps', 
                         'distribution_weibull',
                         'server.R',
                         package = 'teachingApps') 
browseURL(server_dw)

# }

Run the code above in your browser using DataLab