Skip to content

LTER-LIFE/NatureDataCube-Shiny

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NatureDataCube Shiny interface (dummy version for the Spring connection)

This repository contains the R code for a Shiny interface of the NatureDataCube. The idea of the NatureDataCube is that it offers an accessible way for researchers/ecologists to retrieve relevant data. It is a dummy version and it will be used for the Spring Connection. The Shiny interface was made as an example of what the interface of the NatureDataCube could look like and to gather feedback from researchers.

This interface is built upon the work from Minke Mulder (NIOO-KNAW) in October - December 2025.

Opening the Shiny app

To use the Shiny app and continue working with the retrieved data in R, the app must be launched in a specific way so that the output is stored in an R object.

Steps:

  • Navigate to the Shiny app directory
  • Open app.R in RStudio (or another R environment).
  • Install and load all required R packages.
  • Set your working directory to the root folder of the repository: setwd("path/to/NatureDataCube-Shiny")
  • Launch the Shiny app from the R console: data_nc <- runApp("R/naturedatacube_app/app.R")

Launching the app in this way ensures that the output generated through the Shiny interface is returned and stored in the R variable data_nc. This allows you to continue working with the retrieved data in R after closing the app. To retrieve data from the Nature Data Cube, an API token is required. Make sure your token is available in your R session before requesting data.

Generate an API token

To generate your free personal API token to retrieve data you can go to Register API tokens.

Running with Docker or Podman

The app can also be run as a container, which handles all package dependencies automatically.

Setup:

Copy .env.example to .env and fill in your API token:

NDC_TOKEN=your_token_here
SHINY_APP_BASE_URL=/naturedatacube

Run:

# Docker
docker compose up --build

# Podman
podman compose up --build

The app will be available at http://localhost:3838/naturedatacube.

Description

The user can open a Shiny interface which lets them select an area (management area, research site or they cand draw their own area of interest) to retrieve data for. Below is a description of all the files that are in this repository.

Shiny app

Folder: R/naturedatacube_app

This folder contains the R code for the Shiny interface.

Folder: retrieval_functions taken from NatureDataCube-R

This folder contains the retrieval code for constructing the urls.

Data

Folder: data

This folder contains the data of the available study areas.

About

Dummy version of the R Shiny interface of the NatureDataCube

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors