knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
# packages
library(ggplot2)
library(dplyr)
library(tidyr)
library(magrittr)

Introduction

This vignette shows how to

  1. Import raw data files (csv files) as exported from the X-ray fluorescence device in the lab (ZSX Primus II, Rigaku).

  2. Reformat the data to get a tidy data.frame.

  3. Check the data via plots.

  4. Export the data and metadata as csv files in the tidy format.

Data import and reformatting

Data import and reformatting are done with function elco:elco_xrf_import_csv:

# get names of files to import
files <- list.files("./../inst/extdata/xrf/", full.names = TRUE)

# data import
d <- elco::elco_xrf_import_csv(files = files)

Data checks

To check the data, a plot is created for each measured variable and sample and points for which the calibration range was exceeded are colored.

# plot for checking
plot(d)

Data export

To export the data, use elco::elco_xrf_export_csv.

d <- elco::elco_xrf_export_csv(d, file = "./xrf_export.csv")

License

Creative Commons License
This Rmarkdown template is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.

Title: Reformatting and checking raw data (csv files) from the X-ray fluorescence device (ZSX Primus II, Rigaku)
Author: Henning Teickner
Date: 2020-08-05

Data: The data are licensed under the CC-BY-SA-4.0 license. All data for elco were provided by @Gaka.2019.

Session Info

sessionInfo()

References



henningte/elco documentation built on May 21, 2022, 6:56 p.m.