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.
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")
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.