R/icc_function.R

Defines functions icc

Documented in icc

#' Index of color (Camelo et al., 2004)
#'
#' Colors
#' @description  color index (IC) indicating the degree of green / yellow variation of the samples
#' @param a Numeric vector with parameter a
#' @param b Numeric vector with parameter b
#' @param L Numeric vector with parameter L
#' @param trat Vector with the names of the treatments with the repetitions
#' @author Gabriel Danilo Shimizu
#' @references Camelo, A.F.L., Gomes, P.A. 2004. Comparison of color indexes for tomato ripenings. Horticultura Brasileira 22: p.534-537.
#' @import xlsx
#' @keywords a
#' @keywords b
#' @keywords L
#' @keywords hue
#' @keywords chroma
#' @keywords Index
#' @export
#' @examples
#' L=c(47.1,45.7,45.5,45.8)
#' a=c(31.4,30.8,31.7,32)
#' b=c(30.7,28.2,27.5,27.3)
#' icc(a,b,L)

icc = function(a, b, L,save=FALSE){
  icc = (2000*a)/(L*sqrt((a^2)+(b^2)))
  data=data.frame(trat,icc)
  print(data)
  if(save==TRUE){xlsx::write.xlsx(data, "Planilha.xlsx")}}
AgronomiaR/iagro documentation built on April 16, 2020, 10:54 p.m.