cor_spec | R Documentation |
match_spec()
joins two OpenSpecy
objects and their metadata
based on similarity.
cor_spec()
correlates two OpenSpecy
objects, typically one with
knowns and one with unknowns.
ident_spec()
retrieves the top match values from a correlation matrix
and formats them with metadata.
get_metadata()
retrieves metadata from OpenSpecy objects.
max_cor_named()
formats the top correlation values from a correlation
matrix as a named vector.
filter_spec()
filters an Open Specy object.
cor_spec(x, ...)
## Default S3 method:
cor_spec(x, ...)
## S3 method for class 'OpenSpecy'
cor_spec(x, library, na.rm = T, conform = F, type = "roll", ...)
match_spec(x, ...)
## Default S3 method:
match_spec(x, ...)
## S3 method for class 'OpenSpecy'
match_spec(
x,
library,
na.rm = T,
conform = F,
type = "roll",
top_n = NULL,
order = NULL,
add_library_metadata = NULL,
add_object_metadata = NULL,
fill = NULL,
...
)
ident_spec(
cor_matrix,
x,
library,
top_n = NULL,
add_library_metadata = NULL,
add_object_metadata = NULL,
...
)
get_metadata(x, ...)
## Default S3 method:
get_metadata(x, ...)
## S3 method for class 'OpenSpecy'
get_metadata(x, logic, rm_empty = TRUE, ...)
max_cor_named(cor_matrix, na.rm = T)
filter_spec(x, ...)
## Default S3 method:
filter_spec(x, ...)
## S3 method for class 'OpenSpecy'
filter_spec(x, logic, ...)
ai_classify(x, ...)
## Default S3 method:
ai_classify(x, ...)
## S3 method for class 'OpenSpecy'
ai_classify(x, library, fill = NULL, ...)
x |
an |
library |
an |
na.rm |
logical; indicating whether missing values should be removed
when calculating correlations. Default is |
conform |
Whether to conform the spectra to the library wavenumbers or not. |
type |
the type of conformation to make returned by |
top_n |
integer; specifying the number of top matches to return.
If |
order |
an |
add_library_metadata |
name of a column in the library metadata to be
joined; |
add_object_metadata |
name of a column in the object metadata to be
joined; |
fill |
an |
cor_matrix |
a correlation matrix for object and library,
can be returned by |
logic |
a logical or numeric vector describing which spectra to keep. |
rm_empty |
logical; whether to remove empty columns in the metadata. |
... |
additional arguments passed |
match_spec()
and ident_spec()
will return
a data.table-class()
containing correlations
between spectra and the library.
The table has three columns: object_id
, library_id
, and
match_val
.
Each row represents a unique pairwise correlation between a spectrum in the
object and a spectrum in the library.
If top_n
is specified, only the top top_n
matches for each
object spectrum will be returned.
If add_library_metadata
is is.character
, the library metadata
will be added to the output.
If add_object_metadata
is is.character
, the object metadata
will be added to the output.
filter_spec()
returns an OpenSpecy
object.
cor_spec()
returns a correlation matrix.
get_metadata()
returns a data.table-class()
with the metadata for columns which have information.
Win Cowger, Zacharias Steinmetz
adj_intens()
converts spectra;
get_lib()
retrieves the Open Specy reference library;
load_lib()
loads the Open Specy reference library into an R
object of choice
data("test_lib")
unknown <- read_extdata("ftir_ldpe_soil.asp") |>
read_any() |>
conform_spec(range = test_lib$wavenumber,
res = spec_res(test_lib)) |>
process_spec()
cor_spec(unknown, test_lib)
match_spec(unknown, test_lib, add_library_metadata = "sample_name",
top_n = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.