The basic API encapsulates all the functionality of the package in a single function, archeospec::genReport
. It allows different configuration options to generate the combination of outputs carried out in the study.
Data must be provided with an absolute path to directory or tree of directories containing .asd
files. If you need to configure the data format you can do so by appliying the same parametrization from the load_signatures_files
files.
For example:
library(archeospec)
# Absolute directory path containing .asd files and/or folders with more .asd files
# In windows 10
path <- "C:/Users/(username)/Documents/data/signatures"
# In linux
path <- "/home/(username)/data/signatures"
You may choose between different approaches for unmixing and clustering as explored in the original study:
Unmixing specifiying the endmembers
Fixed centroid clustering (selects the endmembers as centroids)
Unmixing can be controlled via the endmembers
argument, a numeric value will trigger the VCA algorithm and a list of characters values will trigger the manual unmixing, notice that the files must be existing signatures in the data.
Clustering can be controlled via the kmeans
boolean argument, a positive value will perform the algorithm while a negative one will fix the endmembers.
# A default report using VCA to compute k=3 endmembers and kmeans:
genReport(
input_source=path,
output="./ex1",
endmembers=5,
kmeans=T,
seed=1000
)
If manual endmembers are selected you may change the displayed name and color for a more clear identification and comparison. This is done via the endmember_names
and endmember_colors
property.
# A default report usingfixed endmembers and clusters:
genReport(
input_source=path,
output="./ex2",
endmembers=c("signature0000.asd", "signature0001.asd", "signature0002.asd", "signature0003.asd", "signature0005.asd"),
endmember_names=c("orange", "red", "black", "white", "base"),
endmember_colors = c("darkorange2", "red2", "gray15", "white", "green4"),
kmeans=F,
seed=1000
)
We can apply a cleaning process to the data using different options. Please notice that they are disabled by default.
clean_head
cuts the lower wavelength values until the value specifiedclean_tail
cuts the higher wavelength values from the value specifiedclean_leaps
smooth the leaps produced when using multiple sensors for different range of wavelengths, produced between sensor changes. You may pass an arbritary number of points.# Filter wavelengths less than 400 and above 2400, and
# smooth the leaps between wavelengths 1000 and 1001, and between 1830 and 1831.
genReport(
input_source=path,
output="./ex3",
endmembers=5,
kmeans=F,
clean_head=400,
clean_tail=2400,
clean_leaps=c(1001, 1831),
seed=1000
)
The report will always include the following plots and tables:
Additional plots are included by default, and can be hidden show using the following options:
intracorrelation=TRUE
shows the intracorrelation plot. We advise to hide it if not needed as it costly to generate.mutualinfo=TRUE
shows the mutual information between clusters and wavelengthsgenReport
will produce all different outputs formats by default, if only a particular type of document is required then it can be specified with the format
options, it takes values from:
html_document
(and md)pdf_document
(and LaTeX)word_document
all
(generating all previous document)# We can render a single format for extended efficiency
genReport(
input_source=path,
output="./ex5",
format="pdf_document"
endmembers=5,
kmeans=T,
seed=1000
)