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

Here we want to read a data cube from the example data. Because of R's limits on gzip, we need to copy manually copy and unzip the file from:

strFile <- system.file("extdata", "qm-04360-Al-200nm-in-Cu-20-kV-NM3.tar.gz", package = "rEDS")
strFile

to $TEMP/rEDS and unzip it.

Set up a work directory and make sure the compressed file exists.

oldWd <- getwd()
newWd <- Sys.getenv("TEMP")
mainDir <- gsub("\\\\","/", newWd)
print(mainDir)
subDir <- paste0(mainDir,'/rEDS')
print(subDir)
dir.create(subDir, showWarnings = FALSE)
setwd(file.path(subDir))
list.files(pattern="*.rpl")

Try to read

library(rEDS)
rplFile <- paste0(subDir,"/qm-04360-Al-200nm-in-Cu-20-kV-NM3.rpl")
rplFile
cube <- readDataCube(rplFile, bOpenExampleSpc = FALSE,
                     exSpecFile="", data.what="integer",
                     record.by.image=TRUE)

str(cube)

Now let's try to plot

plot(cube, ch=206)

Now let's set the directory back

setwd(oldWd)


jrminter/rEDS documentation built on May 19, 2019, 11:54 p.m.