spc.data2header-list-method: Populate fields of header slot using data from data slot

Description Usage Arguments Details Value Examples

Description

Populates a field of @header with a column data from @data slot.

Usage

1
2
## S4 method for signature 'list'
spc.data2header(object, dataname, headerfield, compress = TRUE, ...)

Arguments

object

SpcList 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 spc.data2header.

Details

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.

Value

object of class SpcList

Examples

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

geoSpectral documentation built on Feb. 20, 2020, 5:08 p.m.