Skip to contents

To see all possibilities of the generate_report() function, look here, and of the launch_gcamreport_ui(), look here.

newline

Example 1: launch UI when generating the dataset

When running the main function generate_report (see Dataset Generation Tutorial for more information), simply set launch_ui to TRUE or do not specify anything since this is the default option.

generate_report(..., launch_ui = TRUE)    # this is the default option

newline

Example 2: launch UI once the dataset has been generated

After generating an .RData dataset with the generate_report() function, simply run launch_gcamreport_ui in R specifying either the dataset variable or the path to the .RData dataset. It should be something like /path/to/your/database/..._standardize.RData or /path/to/your/project_file/..._standardize.RData.

# lanuch the user interface specifying the dataset variable name
launch_gcamreport_ui(data = report,           # report is the name of the  
                     GCAM_version = 'v7.1')   # standardized dataset generated  
                                              # by generate_report() function. 
                                              # So, if you see it loaded in your 
                                              # environment, you can easily use 
                                              # it here!! :)

# lanuch the user interface specifying the dataset path
launch_gcamreport_ui(data_path = "/path/to/your/database/..._standardize.RData",
                     GCAM_version = 'v7.1')

newline

Troubleshooting when launching the UI

A) Large error when launching the UI

When running launch_gcamreport_ui(data_path = "path/to/your/data.RData", GCAM_version = 'v7.1'), you might get this message:

launch_gcamreport_ui(data_path = "examples/example3.RData")

Listening on http://127.0.0.1:7278

Attaching package: ‘magrittr’

The following objects are masked from ‘package:testthat’:

equals, is_less_than, not
Attaching package: ‘shinydashboard’

The following object is masked from ‘package:graphics’:

box
Learn different usages for shinyjs and other Shiny tricks:
https://deanattali.com/blog/advanced-shiny-tips

Attaching package: ‘shinyjs’

The following object is masked from ‘package:shinyWidgets’:

alert
The following object is masked from ‘package:shiny’:

runExample
The following objects are masked from ‘package:methods’:

removeClass, show
Warning in file(con, "r") :
cannot open file '/home/user/R/www/style.css': No such file or directory
Warning: Error in file: cannot open the connection
72: file
71: readLines
70: includeCSS
2: runApp
1: launch_gcamreport_ui [/home/user/gcamreport/R/main.R#724]

Possible solution 1: make sure that you cloned the repo. Check the instructions here.

Possible solution 2: make sure that you are using the gcamreport Rproject and that the R session working directory points the gcamreport cloned folder. In addition:

  • In case you are using the gcamreport package following the R installation, try to copy the whole path to your data, for instance data_path = C:\Users\username\Documents\path\to\your\gcamfolder\examples\example3.RData if you are using a Windows distribution.

  • In case you are using the gcamreport package following the Docker installation:

    1. make sure that your dataset is inside the gcamreport folder.

    2. make sure that you typed correctly the path to your gcamreport folder when generating the docker image (5th step in the Docker section)

    3. make sure that you are pointing correctly to your dataset. For example, if in the gcamreport folder you have a folder called examples with your dataset amazingDataset.RData, you should refer to it as

# option 1: full path
generate_report(data_path = "/app/examples/amazingDataset.RData")

# option 2: partial path
generate_report(data_path = "examples/amazingDataset.RData")

newline

B) Short error when launching the UI

When launching the UI either through R, Rstudio or Docker, you might get this message:

Error in `shinyAppDir()`:
! No Shiny application exists at the path "inst/gcamreport_ui"

Possible solution 1: make sure that you are using the gcamreport package through Rstudio (following the full R installation) or Docker. Otherwise the UI can not be launched. Check the installation instructions here.

Possible solution 2: make sure that you have a folder called inst/gcamreport_ui in your working session. It might be that your working directory has changed. To check it, run getwd() on your R console. If necessary, set again the working environment with setwd().

C) Wired message when launching the UI using the Docker installation.

After using the functions generate_report() or launch_gcamreport_ui() to launch the UI, you might get this message:

Listening on http://0.0.0.0:3838
/usr/bin/xdg-open: 882: www-browser: not found
/usr/bin/xdg-open: 882: links2: not found
/usr/bin/xdg-open: 882: elinks: not found
/usr/bin/xdg-open: 882: links: not found
/usr/bin/xdg-open: 882: lynx: not found
/usr/bin/xdg-open: 882: w3m: not found
xdg-open: no method available for opening 'http://127.0.0.1:3838' 

This is not an error! You simply need to either go to your Docker Desktop program and click the last started port

UI error

or open this url http://localhost:4000 in your favourite browser.

D) Error when using the UI through Docker installation.

When opening your localhost, you might see this error:

UI error

Possible solution: your UI is not running. Try to either use the generate_report() function or the launch_gcamreport_ui().