genReport: Create a report

Description Usage Arguments Details Value See Also Examples

Description

Create a report composed of elements specified in the parametrization.

Usage

1
2
3
4
5
6
genReport(input_source, output, format = "all", endmembers, kmeans = F,
  title = "archeospec", clean_head = NULL, clean_tail = NULL,
  clean_leaps = NULL, file_header = "Wavelength\\t%s",
  wavelength_start = 350, wavelength_end = 2500, intracorrelation = T,
  mutualinfo = T, endmember_names = NULL, endmember_colors = NULL,
  seed = 0)

Arguments

input_source

The absolute path to a folder which contains .asd files (or subfolders with .asd files). These files must contain the data as a pair wavelength<tab>value.

output

The path for the output folder. It will contain the report files.

format

The report formats to be generated. One option of "html_document", "pdf_document", "word" or "all" (by default). The "pdf_document" will also include the latex sources.

endmembers

It can be a number or a vector of strings. If it is a number, this number of endmembers will be computer from the signatures. If it is a vector of strings, they will be the filenames of the endmembers which will be fixed.

kmeans

Whether to include the clustering plot or not (TRUE / FALSE)

title

The title for the report, included at the begining of them.

clean_head

Optional. If provided, it filters out the wavelengths smaller than clean_head (a number).

clean_tail

Optional. If provided, it filters out the wavelengths greater than clean_tail (a number)

clean_leaps

Optional. If provided, it must be a vector of wavelength values. It will smooth the leaps produced between sensor changes, when using multiple sensors for different wavelength ranges.

file_header

The format of the hehad in .asd files. After the header, the measurements will be in format wavelength<tab>value. By default, the file header is Wavelength\\t%s (note the double backslash to escape the special character bakslash).

wavelength_start

The smallest wavelength of the measured range.

wavelength_end

The greatest wavelength of the measured range.

intracorrelation

Whether to include the intracorrelation plot or not (TRUE / FALSE)

mutualinfo

Whether to include the mutual information plot or not (TRUE / FALSE)

endmember_names

Optional. If provided, it must be a list of names (strings) to be related to selected endmembers, so we can easily recognise the endmembers in the report. If endmembers is not a list of filenames, this parameter is ignored.

endmember_colors

Optional. If provided, it must be a list of colors (strings) to be related to selected endmembers, so we can easily recognise the endmembers in the report. If endmembers is not a list of filenames, this parameter is ignored. To check the available colors, refer to colors.

seed

A numeric value to controll randomness on the experiments. VCA and Kmeans may produce different outcomes for the same input given the seed.

Details

First load the data from input source. This must be an ABSOLUTE path to a folder which contains .asd files, or a tree of folders which contains in the end .asd files. These files must contain the data as a pair wavelength<tab>value, and the data must starts after the line file_header (by default "Wavelength<tab>

Then, a filtering process can be applied to the signatures if any of clean_head, clean_tail or clean_leaps are specified. This consists, respectively, on cutting the lower / higher wavelength values. clean_leaps smooth the leaps produced when using multiple sensors for different range of wavelengths, produced between sensor changes.

Finally, the signatures are unmixed. If endmembers is a number, it computes such number of endmembers using the VCA algorithm. If endmembers is a vector of filenames, then those signatures will be selected as endmembers. In this case, we can assign them a representative name and a fixed color (using endmember_names and endmember_colors), so we can easily recognize this signatures in the report. endmember_names is a vector of string names, and endmember_colors is a vector of string colors (check colors).

Different outputs can optionaly be included in the report:

The report will always include:

For more details see the doc in [GitHub](https://github.com/jacintoArias/archeospec/).

Value

It creates a report in html, latex, pdf and / or word formats.

See Also

load_signature_files

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Not run: 

# Path must be absolute
# In windows 10
path <- "C:/Users/(username)/Documents/data/signatures"
# Where signatures contain .asd files and folders with more .asd files

# In linux
path <- "/home/(username)/data/signatures"

path <- "/path/to/asd/folder"

# generate a report computing three endmembers.
genReport(path, endmembers=3, seed=1000)

# generate a report selecting two endmembers.
genReport(path, endmembers=c("almagre.asd.txt", "blanco.asd.txt"), seed=1000)

# generate a report filtering the signatures and computing three endmembers.
genReport(path, clean_head=400, clean_tail=2400, clean_leaps=c(1001, 1831), endmembers=3, seed=1000)

# generate a report filtering the signatures and selecting two endmembers, giving them a name and a color.
endmembers <- c("signature0000.asd", "signature0001.asd", )
names <- c("red", "white")
colors <- c("red2", "white")

genReport(path, clean_head=400, clean_tail=2400, clean_leaps=c(1001, 1831),
          endmembers=endmembers, endmember_names=names, endmember_colors=colors, seed=1000)

## End(Not run)

jacintoArias/archeospec documentation built on May 17, 2019, 5:52 p.m.