R/Minimise_elements2.R

Defines functions Minimise_elements2

Documented in Minimise_elements2

#' A function that reduces every for every element that didn't reduce in index function
#' 
#' @keywords internal
#'
#' @param Fmat   xx
#' @param place  xx
#' @param S   xx
#' @param cm  xx
#'
#' @return
#'
#' @examples
Minimise_elements2 <- function(Fmat, place, S, cm){   # A function that reduces every for every element that didn't reduce in index function
  f <- Conduit_2(Fmat, place, S, cm) # Calls index function
  F.new <- f[[1]] # F matrix
  n <- f[[2]] #elements that reduce error
  if (is.null(n)){n <- place}
  F.old <- f[[3]] # old F matrix
  F.initial <- F.new # Fac_F new matrix
  # Fac_F new matrix
  g <-Fac_F_RR2(F.new, vary = place, place, S, cm)
  if (g[[1]][[2]] < F.initial[[2]]){F.new <- g[[1]]}
  n <- g[[2]]
  res <- list(F.new,n)
  return(F.new)
}

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.