R/negativeA0.R

Defines functions negative_A0

Documented in negative_A0

#' Negative A0
#'
#' Negative A0
#'
#' @author Shoji F. Nakayama
#'
#' @param X original data matrix X
#' @param Y A0
#' @param k number of end-members
#'
#' @export
#'

negative_A0 <- function(X, Y, k){
  nrows <- nrow(X)

  n <-0
  tag <- 0
  for (i in 1:nrows){
    for (j in 1:k){
      if (Y[i, j]> (-0.25) & Y[i, j] < (-0.05)){
        n <- n + 1
      }
      else{
        n <- n
      }
    }
  }
  if (n == 0){
    return(tag)
  }
  else{
    return(tag + 1)
  }
}
fabregithub/pva4jecs documentation built on Dec. 20, 2021, 7:40 a.m.