Description Usage Arguments Details Value Examples
Populates a field of @header with a column data from @data slot.
1 2 | ## S4 method for signature 'list'
spc.data2header(object, dataname, headerfield, compress = TRUE, ...)
|
object |
|
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 |
TRUE or FALSE |
... |
arguments to be passed to or from methods. See help of |
This function extracts data from a column of the @data slot (specified by dataname) and creates a new @header field with it. If headerfield 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 headerfield. 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 SpcList
1 2 3 4 5 6 7 8 | sp=spc.example_spectra()
BL=spc.makeSpcList(sp,"CAST")
BL[[1]]@header
BL[[1]]=spc.data2header(BL[[1]],"CAST","ProjectCast")
BL[[1]]@header
BL[[1]]$CAST=rep(33, nrow( BL[[1]]))
BL[[1]]=spc.data2header(BL[[1]],"CAST","ProjectCast", compress=TRUE)
BL[[1]]@header
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.