Quick start

SPS example usage

To start with SPS after installation:

Load package

Load the systemPipeShiny package in your R session.

library(systemPipeShiny)
## Loading required package: shiny
## Loading required package: spsUtil
## Loading required package: spsComps
## Loading required package: drawer

Initialize SPS project

Before launching the SPS application, a project environment needs to be created with the following command.

spsInit()

For this demo, the project directory structure is written to a temporary directory on a user’s system. For a real project, it should be written to a defined and user controlled location on a system rather than a temporary directory.

sps_tmp_dir <- tempdir()
spsInit(app_path = sps_tmp_dir, change_wd = FALSE, project_name = "SPSProject")
## [SPS-INFO] 2021-04-12 11:31:39 Start to create a new SPS project
## [SPS-INFO] 2021-04-12 11:31:39 Create project under /tmp/RtmpgROsL7/SPSProject
## [SPS-INFO] 2021-04-12 11:31:39 Now copy files
## [SPS-INFO] 2021-04-12 11:31:39 Create SPS database
## [SPS-INFO] 2021-04-12 11:31:39 Created SPS database method container
## [SPS-INFO] 2021-04-12 11:31:39 Creating SPS db...
## [SPS-DANGER] 2021-04-12 11:31:39 Done, Db created at '/tmp/RtmpgROsL7/SPSProject/config/sps.db'. DO NOT share this file with others or upload to open access domains.
## [SPS-INFO] 2021-04-12 11:31:39 Key md5 ae88518aa6cce9a5af24d37c4c3c1b16
## [SPS-INFO] 2021-04-12 11:31:39 SPS project setup done!
sps_dir <- file.path(sps_tmp_dir, "SPSProject")

SPS project structure

The file and directory structure of an SPS project is organized as follows.

SPS_xx/  
├── server.R               | 
├── global.R               | Most important server, UI and global files, unless special needs, `global.R` is the only file you need to edit manually   
├── ui.R                   |  
├── deploy.R               | Deploy helper file  
├── config                 | Important app config files. Do not edit them if you don't know  
│   ├── sps.db             | SPS database 
│   ├── sps_options.yaml   | SPS default option list 
│   └── tabs.csv           | SPS tab information 
├── data                   | App example data files 
│   ├── xx.csv             
├── R                      | All SPS additional tab files and helper R function files 
│   ├── tab_xx.R            
├── README.md              
├── results                | Not in use for this current version, you can store some data been generated from the app 
│   └── README.md          
└── www                    | Internet resources  
    ├── about              | About tab information 
    │   └── xx.md          
    ├── css                | CSS files  
    │   └── sps.css         
    ├── img                | App image resources    
    │   └── xx.png         
    ├── js                 | Javascripts
    │   └── xx.js           
    ├── loading_themes     | Loading screen files 
    │   └── xx.html         
    └── plot_list          | Image files for plot gallery  
        └── plot_xx.jpg      

Launch SPS

By default, the working directory will be set inside the project folder automatically. To launch the SPS Shiny application, one only needs to execute the following command.

shiny::runApp()

After the SPS app has been launched, clicking the “Continue to app” button on the welcome screen will open the main dashboard (Fig.2).

sps_ui

Figure 2: Snapshot of SPS' UI.

  1. Welcome screen.
  2. Module tabs.
  3. User defined custom tabs.
  4. The Canvas tab.
  5. All SPS tabs has this description on top. It is highly recommend to click here to expand and read the full the description for the first time.

Alternatively, when using RStudio one can click the Run App button in the top right corner.

In addition, in Rstudio the global.R file will be automatically opened when the SPS project is created. Custom changes can be made inside this file before the app launches. Later we will discuss how to change and create new custom tabs and change other settings.

Last modified 0001-01-01