How to use the Pandora Data Package

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

os_linux <- Sys.info()["sysname"] == "Linux"
library(Pandora)
library(magrittr)

Introduction

This vignette provides an overview of the basic functions within the Pandora Data package, allowing users to explore and retrieve information about networks, repositories, file types, and resources.

Show all Networks

To show all available networks use the getNetworks() function:

networks <- getNetworks()
networks %>% 
  knitr::kable()

List Repositories

To list all available repositories use the getRepositories() function. You can filter the output using the network and pattern arguments. For instance, to list all repositories in the IsoMemo network:

reposIsomemo <- getRepositories(
  network = "IsoMemo"
  )

reposIsomemo[c("Repository")]  %>% 
  knitr::kable()

List Available File Types

Use the getFileTypes() function to list all available file types. The following example showcases file types available in the 'IsoMemo' network:

fileTypesIsomemo <- getFileTypes(network = "isomemo")
fileTypesIsomemo  %>% 
  knitr::kable()

Filter Resources by pattern or File Type

To list all available resources, employ the getResources() function. Filter the output using the network, repository, fileType, and pattern arguments. For instance, to list all CSV files whose meta information contains the string plants:

resourcesPlants <- getResources(
  fileType = c("csv"),
  pattern = "plant"
  )

resourcesPlants[c("name", "format")]  %>% 
  knitr::kable()

Get the data of a Specific Resource

To retrieve data from a specific resource, use the getData() function. For text files one can specify e.g. the separator using the helper function dataOptions(). The example below demonstrates fetching data from the "CIMA Humans 29.05.2021 CSV" resource:

isotopicData <- getData(
  name = "CIMA Animals 29.05.2021 CSV",
  options = dataOptions(sep = ";")) 
isotopicData  %>% 
  head(5)  %>% 
  dplyr::select(c("Entry_ID", "General_Category_Family", "Common_Name", "Sampled_Element", "Analysed_Component")) %>%
  knitr::kable()


Try the Pandora package in your browser

Any scripts or data that you put into this service are public.

Pandora documentation built on June 22, 2024, 6:48 p.m.