R/Normalise_S.R

Defines functions Normalise_S

Documented in Normalise_S

#' This function normalises each column in S to row sum
#' 
#'
#' @keywords internal
#'
#' @param S   xx
#'
#' @return A matrix
#'
#' @examples
#' 
Normalise_S <- function(S){
  S <- S[,1:ncol(S)]
  #Normalise to unit row sum
  S.sum <- rowSums(S)
  S <- S/S.sum  
  #vectorise / matrices
  Sm <- as.matrix(S)
  Sn <- as.vector(Sm[1,])
  return(Sm)
}

Try the phytoclass package in your browser

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

phytoclass documentation built on April 4, 2025, 4:02 a.m.