R/XPSSpectList.r

Defines functions XPSSpectList

Documented in XPSSpectList

# creates the list of spectra associated to an XPSSample

#' @title XPSSpectList
#' @description XPSSpectList shows the list of spctra related to
#'   object of class XPSSample. The spectra are identified by their
#'   an index or by the CoreLine name
#' @param SelectedFName the name (string) of the selected XPSSample
#' @param noIdx logical if FALSE a numerical index is added to any CoreLine name
#' @examples
#' \dontrun{
#' 	XPSSampleInfo(SelectedFName, noIdx=FALSE)
#' }
#' @export
#'


XPSSpectList <- function(SelectedFName, noIdx=FALSE) {
     if (is.na(SelectedFName)){
        gmessage("No data present: please load and XPS Sample", title="XPS SAMPLES MISSING", icon="error")
        return()
     }
     FName <- get(SelectedFName, envir=.GlobalEnv)
     CoreLineList=""
     CoreLineList <- FName@names
     LL <- length(CoreLineList)
     if (noIdx==FALSE){
        for (ii in 1:LL){
               CoreLineList[ii] <- paste(ii,".",CoreLineList[ii], sep="")   #Add number at beginning of the corelines to identify spectra with saame name
        }
     }
     return(CoreLineList)
}
GSperanza/RxpsG_2.3-1 documentation built on Feb. 11, 2024, 5:09 p.m.