Loading Metadata Report

knitr::opts_chunk$set(echo = FALSE)
# Dependencies
library(AlpsNMR)
requireNamespace("purrr")
requireNamespace("readxl")
requireNamespace("htmltools")
requireNamespace("DT")
# These should be defined in the environment that calls rmarkdown::render
if (!exists("nmr_dataset")) {
  stop("nmr_dataset should be defined before running this notebook")
  nmr_dataset <- NULL # to make linter happy
}
if (!exists("excel_file")) {
  stop("excel_file should be defined before running this notebook")
  excel_file <- NULL # to make linter happy
}
if (!exists("xlsx_file")) {
  stop("xlsx_file should be defined before running this notebook")
  xlsx_file <- NULL # to make linter happy
}
if (!exists("nmr_dataset_outfile")) {
  stop("nmr_dataset_outfile should be defined before running this notebook")
  nmr_dataset_outfile <- NULL # to make linter happy
}

xlsx Input files

These are the input metadata tables that will be integrated:

excel_sheets <- readxl::excel_sheets(excel_file)
excel_dfs <- purrr::map(excel_sheets, ~readxl::read_excel(path = excel_file, sheet = .))
excel_dfs %>%
  purrr::map(DT::datatable) %>%
  htmltools::tagList()

The added and linked metadata

nmr_dataset <- nmr_meta_add_tidy_excel(nmr_dataset, excel_file)
nmr_meta_export(nmr_dataset, xlsx_file, groups = "external")
nmr_dataset_save(nmr_dataset, nmr_dataset_outfile)
nmr_dataset %>%
  nmr_meta_get(groups = "external") %>%
  DT::datatable()


Try the AlpsNMR package in your browser

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

AlpsNMR documentation built on April 1, 2021, 6:02 p.m.