R/speclib_id.R

Defines functions idSpeclib

Documented in idSpeclib

idSpeclib <- function(x)
{
if (!is.speclib(x))
  stop("Class of x must be Speclib")
ids <- x@ID

return(if (any(c(length(x@ID) != nspectra(x), anyDuplicated(ids)))) c(1:nspectra(x)) else ids)
}

"idSpeclib<-" <- function(x, value)
{
  xx <- x
  xx@ID <- value
  x <- xx
}

Try the hsdar package in your browser

Any scripts or data that you put into this service are public.

hsdar documentation built on March 18, 2022, 6:35 p.m.