Description Usage Arguments Details Value Examples
Populates a field of @header with a column data from @data slot.
1 2 3 4 | spc.data2header(object,dataname,headerfield,compress,...)
## S4 method for signature 'Spectra'
spc.data2header(object, dataname, headerfield, compress = FALSE, ...)
|
object |
A |
dataname |
A character object specifying the name of @data column to be used. |
headerfield |
A character object specifying the name of the @header field to be changed |
compress |
logical. Whether or not to compress data put into the header. See the description section. |
... |
arguments to be passed to or from other methods |
This function extracts data from a column of the @data slot (specified by dataname) and creates a new @header field with it. Ifa header field is not provided, the name of the new header field will be the same as dataname.
The name of the new header field can be overwritten by providing header field. If all the incoming data rows (dataname) are the same, information put into the header can be compressed by selecting compress=TRUE (default is FALSE). This would take only the first element from the @data column.
object of class Spectra
1 2 3 4 5 6 7 8 | sp=spc.example_spectra()
sp=spc.data2header(sp,"CAST")
sp@header
sp=spc.data2header(sp,"CAST","ProjectCast")
sp@header
sp$CAST=rep(33, nrow(sp))
sp=spc.data2header(sp,"CAST","ProjectCast", compress=TRUE)
sp@header
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.