Overview

This Notebook will give an overview of using caladaptR in Shiny.

An easy way to run sample Shiny apps powered by Cal-Adapt is using the caladaptr.apps package. After loading the package, you can launch an app with ca_lauch():

library(caladaptr.apps)

## Run the following to launch the timeseries sample app:
# ca_launch("timeseries")


Pro Tip:


To see the Shiny app code side-by-side the app, add display.mode = "showcase".

# ca_launch("timeseries", display.mode = "showcase")


Build a simple Shiny app

We’re going to build the timeseries Shiny app.

You’ve seen the GUI. Let’s look at the ‘final’ reactivity map:

Begin by opening ts_app_01.R. What’s the first thing we have to do?

Livecode demo


LS0tDQp0aXRsZTogImNhbGFkYXB0UiBpbiBTaGlueSINCm91dHB1dDoNCiAgaHRtbF9ub3RlYm9vazogDQogICAgY3NzOiBodHRwczovL3VjYW5yLWlnaXMuZ2l0aHViLmlvL2NhbGFkYXB0ci1yZXMvYXNzZXRzL25iX2NzczAxLmNzcw0KICAgIGluY2x1ZGVzOg0KICAgICAgYWZ0ZXJfYm9keTogaHR0cHM6Ly91Y2Fuci1pZ2lzLmdpdGh1Yi5pby9jYWxhZGFwdHItcmVzL2Fzc2V0cy9uYl9mb290ZXIwMS5odG1sDQotLS0NCg0KIyBPdmVydmlldw0KDQpUaGlzIE5vdGVib29rIHdpbGwgZ2l2ZSBhbiBvdmVydmlldyBvZiB1c2luZyBjYWxhZGFwdFIgaW4gU2hpbnkuDQoNCkFuIGVhc3kgd2F5IHRvIHJ1biBzYW1wbGUgU2hpbnkgYXBwcyBwb3dlcmVkIGJ5IENhbC1BZGFwdCBpcyB1c2luZyB0aGUgYGNhbGFkYXB0ci5hcHBzYCBwYWNrYWdlLiBBZnRlciBsb2FkaW5nIHRoZSBwYWNrYWdlLCB5b3UgY2FuIGxhdW5jaCBhbiBhcHAgd2l0aCBgY2FfbGF1Y2goKWA6DQoNCmBgYHtyfQ0KbGlicmFyeShjYWxhZGFwdHIuYXBwcykNCg0KIyMgUnVuIHRoZSBmb2xsb3dpbmcgdG8gbGF1bmNoIHRoZSB0aW1lc2VyaWVzIH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