R/Spectra-class.R

setMethod("ncol", signature(x = ".Spectra"), 
          function(x)
  if (x@fromRaster)
  {
    return(x@spectra_ra@data@nlayers)
  } else {
    return(ncol(x@spectra_ma))
  }
)

setMethod("nrow", signature(x = ".Spectra"), 
          function(x)
  if (x@fromRaster)
  {
    return(x@spectra_ra@nrows * x@spectra_ra@ncols)
  } else {
    return(nrow(x@spectra_ma))
  }
)

Try the hsdar package in your browser

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

hsdar documentation built on June 21, 2018, 9 a.m.