2012/src/check.consis.SP.R

# TODO: Add comment
# 
# Author: reyzaguirre
###############################################################################

###############################################################################
## Sweet Potato consistency check for Data Collector 
###############################################################################

## Check for inconsistencies and outliers

## Number of plants planted per plot (NOPS) is in sheet Installation cell B8
## Number of plants planted per plot (NOPS) must be filled in automatically in fieldbook
## Data is loaded in object datos

sink("d:/checks.txt")

## NOPS > NOPE > NOPH > NOPR

if (exists("NOPE", where=datos)==1 & exists("NOPS", where=datos)==1)
	if (dim(subset(datos, NOPE>NOPS))[1]>0){
		cat("\n","Number of plants established (NOPE) greater than number of plants sowed (NOPS):","\n")
		subset(datos, NOPE>NOPS)
	}

if (exists("NOPH", where=datos)==1 & exists("NOPE", where=datos)==1)
	if (dim(subset(datos, NOPH>NOPE))[1]>0){
		cat("\n","Number of plants harvested (NOPH) greater than number of plants established (NOPE):","\n")
		subset(datos, NOPH>NOPE)
	}


if (exists("NOPH", where=datos)==1 & exists("NOPS", where=datos)==1){
	if (exists("NOPE", where=datos)==1){
		if (dim(subset(datos, is.na(NOPE)==1 & NOPH>NOPS))[1]>0){
			cat("\n","Number of plants harvested (NOPH) greater than number of plants sowed (NOPS):","\n")
			subset(datos, is.na(NOPE)==1 & NOPH>NOPS)			
		}
	} else {
		if (dim(subset(datos, NOPH>NOPS))[1]>0){
			cat("\n","Number of plants harvested (NOPH) greater than number of plants sowed (NOPS):","\n")
			subset(datos, NOPH>NOPS)
		}
	}
}

if (exists("NOPR", where=datos)==1 & exists("NOPH", where=datos)==1)
	if (dim(subset(datos, NOPR>NOPH))[1]>0){
		cat("\n","Number of plants with roots (NOPR) greater than number of plants harvested (NOPH):","\n")
		subset(datos, NOPR>NOPH)
	}

if (exists("NOPR", where=datos)==1 & exists("NOPE", where=datos)==1){
	if (exists("NOPH", where=datos)==1){
		if (dim(subset(datos, is.na(NOPH)==1 & NOPR>NOPE))[1]>0){
			cat("\n","Number of plants with roots (NOPR) greater than number of plants established (NOPE):","\n")
			subset(datos, is.na(NOPH)==1 & NOPR>NOPE)
		}
	} else {
		if (dim(subset(datos, NOPR>NOPE))[1]>0){
			cat("\n","Number of plants with roots (NOPR) greater than number of plants established (NOPE):","\n")
			subset(datos, NOPR>NOPE)
		}
	}
}

if (exists("NOPR", where=datos)==1 & exists("NOPS", where=datos)==1){
	if (exists("NOPH", where=datos)==1 & exists("NOPE", where=datos)==1){
		if (dim(subset(datos, is.na(NOPH)==1 & is.na(NOPE)==1 & NOPR>NOPS))[1]>0){
			cat("\n","Number of plants with roots (NOPR) greater than number of plants sowed (NOPS):","\n")
			subset(datos, is.na(NOPH)==1 & is.na(NOPE)==1 & NOPR>NOPS)
		}
	} else {
		if (dim(subset(datos, NOPR>NOPS))[1]>0){
			cat("\n","Number of plants with roots (NOPR) greater than number of plants sowed (NOPS):","\n")
			subset(datos, NOPR>NOPS)
		}
	}
}

## NOPE and dependencies

if (exists("NOPE", where=datos)==1 & exists("VIR1", where=datos)==1)
	if (dim(subset(datos, (NOPE==0 | is.na(NOPE)==1) & is.na(VIR1)==0))[1]>0){
		cat("\n","Number of plants established (NOPE) is zero or NA but there is data for virus symptoms first evaluation (VIR1):","\n")
		subset(datos, (NOPE==0 | is.na(NOPE)==1) & is.na(VIR1)==0)
	}

if (exists("NOPE", where=datos)==1 & exists("VIR2", where=datos)==1)
	if (dim(subset(datos, (NOPE==0 | is.na(NOPE)==1) & is.na(VIR2)==0))[1]>0){
		cat("\n","Number of plants established (NOPE) is zero or NA but there is data for virus symptoms second evaluation (VIR2):","\n")
		subset(datos, (NOPE==0 | is.na(NOPE)==1) & is.na(VIR2)==0)
	}

if (exists("NOPE", where=datos)==1 & exists("ALT1", where=datos)==1)
	if (dim(subset(datos, (NOPE==0 | is.na(NOPE)==1) & is.na(ALT1)==0))[1]>0){
		cat("\n","Number of plants established (NOPE) is zero or NA but there is data for alternaria symptoms first evaluation (ALT1):","\n")
		subset(datos, (NOPE==0 | is.na(NOPE)==1) & is.na(ALT1)==0)
	}

if (exists("NOPE", where=datos)==1 & exists("ALT2", where=datos)==1)
	if (dim(subset(datos, (NOPE==0 | is.na(NOPE)==1) & is.na(ALT2)==0))[1]>0){
		cat("\n","Number of plants established (NOPE) is zero or NA but there is data for alternaria symptoms second evaluation (ALT2):","\n")
		subset(datos, (NOPE==0 | is.na(NOPE)==1) & is.na(ALT2)==0)
	}

if (exists("NOPE", where=datos)==1 & exists("VV1", where=datos)==1)
	if (dim(subset(datos, (NOPE==0 | is.na(NOPE)==1) & is.na(VV1)==0))[1]>0){
		cat("\n","Number of plants established (NOPE) is zero or NA but there is data for vine vigor first evaluation (VV1):","\n")
		subset(datos, (NOPE==0 | is.na(NOPE)==1) & is.na(VV1)==0)
	}

## NOPH and VW

if (exists("NOPH", where=datos)==1 & exists("VW", where=datos)==1)
	if (dim(subset(datos, (NOPH==0 | is.na(NOPH)==1) & VW>0))[1]>0){
		cat("\n","Number of plants harvested (NOPH) is zero or NA but vine weight (VW) is greater than zero:","\n")
		subset(datos, (NOPH==0 | is.na(NOPH)==1) & VW>0)
	}

if (exists("NOPH", where=datos)==1 & exists("VW", where=datos)==1)		
	if (dim(subset(datos, NOPH>0 & (VW==0 | is.na(VW)==1)))[1]>0){
		cat("\n","Vine weight (VW) is zero or NA but the number of plants harvested (NOPH) is greater than zero:","\n")
		subset(datos, NOPH>0 & (VW==0 | is.na(VW)==1))
	}

## VW and dependencies

if (exists("VW", where=datos)==1 & exists("DMVF", where=datos)==1)
	if (dim(subset(datos, (VW==0 | is.na(VW)==1) & DMVF>0))[1]>0){
		cat("\n","Vine weight (VW) is zero or NA but there is fresh weight vines for dry matter assessment (DMVF):","\n")
		subset(datos, (VW==0 | is.na(VW)==1) & DMVF>0)
	}

if (exists("VW", where=datos)==1 & exists("DMVD", where=datos)==1)
	if (dim(subset(datos, (VW==0 | is.na(VW)==1) & DMVD>0))[1]>0){
		cat("\n","Vine weight (VW) is zero or NA but there is dry weight vines for dry matter assessment (DMVD):","\n")
		subset(datos, (VW==0 | is.na(VW)==1) & DMVD>0)
	}

if (exists("DMVF", where=datos)==1 & exists("DMVD", where=datos)==1)
	if (dim(subset(datos, DMVD>DMVF))[1]>0){
		cat("\n","Dry weight vines for dry matter assessment (DMVD) is greater than fresh weight vines for dry matter assessment (DBVF):","\n")
		subset(datos, DMVD>DMVF)
	}

if (exists("VW", where=datos)==1 & exists("VV2", where=datos)==1)
	if (dim(subset(datos, (VW==0 | is.na(VW)==1) & is.na(VV2)==0))[1]>0){
		cat("\n","Vine weight (VW) is zero or NA but there is data for vine vigor second evaluation (VV2):","\n")
		subset(datos, (VW==0 | is.na(VW)==1) & is.na(VV2)==0)
	}

if (exists("VW", where=datos)==1 & exists("VIR3", where=datos)==1)
	if (dim(subset(datos, (VW==0 | is.na(VW)==1) & is.na(VIR3)==0))[1]>0){
		cat("\n","Vine weight (VW) is zero or NA but there is data for virus symptoms third evaluation (VIR3):","\n")
		subset(datos, (VW==0 | is.na(VW)==1) & is.na(VIR3)==0)
	}

## NOPR and number of roots

if (exists("NOPR", where=datos)==1 & exists("NOCR", where=datos)==1 & exists("NONC", where=datos)==1)
	if (dim(subset(datos, (NOPR==0 | is.na(NOPR)==1) & (NOCR>0 | NONC>0)))[1]>0){
		cat("\n","Number of plants with roots (NOPR) is zero or NA but number of roots (NOCR+NONC) is greater than zero:","\n")
		subset(datos, (NOPR==0 | is.na(NOPR)==1) & (NOCR>0 | NONC>0))
	}

if (exists("NOPR", where=datos)==1 & exists("NOCR", where=datos)==1 & exists("NONC", where=datos)==1)
	if (dim(subset(datos, NOPR>0 & ((NOCR+NONC)==0 | (NOCR==0 & is.na(NONC)==1) | (is.na(NOCR)==1 & NONC==0) |
								(is.na(NOCR)==1 & is.na(NONC)==1))))[1]>0){
		cat("\n","Number of roots (NOCR+NONC) is zero or NA but number of plants with roots (NOPR) is greater than zero:","\n")
		subset(datos, NOPR>0 & ((NOCR+NONC)==0 | (NOCR==0 & is.na(NONC)==1) | (is.na(NOCR)==1 & NONC==0) |
							(is.na(NOCR)==1 & is.na(NONC)==1)))
	}

## Number of roots and root weight

if (exists("NOCR", where=datos)==1 & exists("CRW", where=datos)==1)
	if (dim(subset(datos, (NOCR==0 | is.na(NOCR)==1) & CRW>0))[1]>0){
		cat("\n","Number of commercial roots (NOCR) is zero or NA but the commercial root weight (CRW) is greater than zero:","\n")
		subset(datos, (NOCR==0 | is.na(NOCR)==1) & CRW>0)
	}

if (exists("NOCR", where=datos)==1 & exists("CRW", where=datos)==1)
	if (dim(subset(datos, NOCR>0 & (CRW==0 | is.na(CRW)==1)))[1]>0){
		cat("\n","Commercial root weight (CRW) is zero or NA but the number of commercial roots (NOCR) is greater than zero:","\n")
		subset(datos, NOCR>0 & (CRW==0 | is.na(CRW)==1))
	}

if (exists("NONC", where=datos)==1 & exists("NCRW", where=datos)==1)
	if (dim(subset(datos, (NONC==0 | is.na(NONC)==1) & NCRW>0))[1]>0){
		cat("\n","Number of non commercial roots (NONC) is zero or NA but the non commercial root weight (NCRW) is greater than zero:","\n")
		subset(datos, (NONC==0 | is.na(NONC)==1) & NCRW>0)
	}

if (exists("NONC", where=datos)==1 & exists("NCRW", where=datos)==1)
	if (dim(subset(datos, NONC>0 & (NCRW==0 | is.na(NCRW)==1)))[1]>0){
		cat("\n","Non commercial root weight (NCRW) is zero or NA but the number of non commercial roots (NONC) is greater than zero:","\n")
		subset(datos, NONC>0 & (NCRW==0 | is.na(NCRW)==1))
	}

## TRW, CRW+NCRW, NOCR+NONC, NOPR

if (exists("TRW", where=datos)==1 & exists("NOPR", where=datos)==1)
	if (dim(subset(datos, (TRW==0 | is.na(TRW)==1) & NOPR>0))[1]>0){
		cat("\n","Total root weight (TRW) is zero or NA but number of plants with roots (NOPR) is greater than zero:","\n")
		subset(datos, (TRW==0 | is.na(TRW)==1) & NOPR>0)
	}

if (exists("TRW", where=datos)==1 & exists("CRW", where=datos)==1 & exists("NCRW", where=datos)==1)
	if (dim(subset(datos, (TRW==0 | is.na(TRW)==1) & (CRW>0 | NCRW>0)))[1]>0){
		cat("\n","Total root weight (TRW) is zero or NA but root weight (CRW+NCRW) is greater than zero:","\n")
		subset(datos, (TRW==0 | is.na(TRW)==1) & (CRW>0 | NCRW>0))
	}

if (exists("TRW", where=datos)==1 & exists("NOCR", where=datos)==1 & exists("NONC", where=datos)==1)
	if (dim(subset(datos, (TRW==0 | is.na(TRW)==1) & (NOCR>0 | NONC>0)))[1]>0){
		cat("\n","Total root weight (TRW) is zero or NA but number of roots (NOCR+NONC) is greater than zero:","\n")
		subset(datos, (TRW==0 | is.na(TRW)==1) & (NOCR>0 | NONC>0))
	}

if (exists("CRW", where=datos)==1 & exists("NCRW", where=datos)==1 & exists("NOPR", where=datos)==1)
	if (dim(subset(datos, NOPR>0 & ((CRW+NCRW)==0 | (CRW==0 & is.na(NCRW)==1) | (is.na(CRW)==1 & NCRW==0) |
								(is.na(CRW)==1 & is.na(NCRW)==1))))[1]>0){
		cat("\n","Root weight (CRW+NCRW) is zero or NA but number of plants with roots (NOPR) is greater than zero:","\n")
		subset(datos, NOPR>0 & ((CRW+NCRW)==0 | (CRW==0 & is.na(NCRW)==1) | (is.na(CRW)==1 & NCRW==0) |
							(is.na(CRW)==1 & is.na(NCRW)==1)))
	}

## Roots and dependencies

if (exists("NOPR", where=datos)==1)
	datos$RAUX <- datos$NOPR else
if (exists("NOCR", where=datos)==1 & exists("NONC", where=datos)==1)
	datos$RAUX <- apply(cbind(datos$NOCR, datos$NONC), 1, sum, na.rm=T) else
if (exists("CRW", where=datos)==1 & exists("NCRW", where=datos)==1)
	datos$RAUX <- apply(cbind(datos$CRW, datos$NCRW), 1, sum, na.rm=T) else
if (exists("TRW", where=datos)==1)
	datos$RAUX <- datos$TRW

if (exists("RAUX", where=datos)==1 & exists("RFCP", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(RFCP)==0))[1]>0){
		cat("\n","There are no roots but there is data for root primary flesh color (RFCP):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(RFCP)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("RFCS", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(RFCS)==0))[1]>0){
		cat("\n","There are no roots but there is data for root secondary flesh color (RFCS):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(RFCS)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("SCOL", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(SCOL)==0))[1]>0){
		cat("\n","There are no roots but there is data for storage root skin color (SCOL):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(SCOL)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("FCOL", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(FCOL)==0))[1]>0){
		cat("\n","There are no roots but there is data for storage root flesh color (FCOL):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(FCOL)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("RS", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(RS)==0))[1]>0){
		cat("\n","There are no roots but there is data for root size (RS):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(RS)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("RF", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(RF)==0))[1]>0){
		cat("\n","There are no roots but there is data for root form (RF):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(RF)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("DAMR", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(DAMR)==0))[1]>0){
		cat("\n","There are no roots but there is data for root defects (DAMR):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(DAMR)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("WED1", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(WED1)==0))[1]>0){
		cat("\n","There are no roots but there is data for weevil damage first evaluation (WED1):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(WED1)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("DMF", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(DMF)==0))[1]>0){
		cat("\n","There are no roots but there is data for fresh weight of roots for dry matter assessment (DMF):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(DMF)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("DMD", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(DMD)==0))[1]>0){
		cat("\n","There are no roots but there is data for dry weight of roots for dry matter assessment (DMD):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(DMD)==0, select = -RAUX)
	}

if (exists("DMF", where=datos)==1 & exists("DMD", where=datos)==1)
	if (dim(subset(datos, DMF<DMD))[1]>0){
		cat("\n","Dry weight of roots for dry matter assessment (DMD) is greater than fresh weight of roots for dry matter assessment (DMF):","\n")
		subset(datos, DMF<DMD, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("FRAW1", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(FRAW1)==0))[1]>0){
		cat("\n","There are no roots but there is data for root fiber first determination (FRAW1):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(FRAW1)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("SURAW1", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(SURAW1)==0))[1]>0){
		cat("\n","There are no roots but there is data for root sugar first determination (SURAW1):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(SURAW1)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("STRAW1", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(STRAW1)==0))[1]>0){
		cat("\n","There are no roots but there is data for root starch first determination (STRAW1):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(STRAW1)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("COOF1", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOF1)==0))[1]>0){
		cat("\n","There are no roots but there is data for cooked fiber first evaluation (COOF1):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOF1)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("COOSU1", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOSU1)==0))[1]>0){
		cat("\n","There are no roots but there is data for cooked sugars first evaluation (COOSU1):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOSU1)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("COOST1", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOST1)==0))[1]>0){
		cat("\n","There are no roots but there is data for cooked starch first evaluation (COOST1):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOST1)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("COOT1", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOT1)==0))[1]>0){
		cat("\n","There are no roots but there is data for cooked taste first evaluation (COOT1):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOT1)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("COOAP1", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOAP1)==0))[1]>0){
		cat("\n","There are no roots but there is data for cooked appearance first evaluation (COOAP1):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOAP1)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("WED2", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(WED2)==0))[1]>0){
		cat("\n","There are no roots but there is data for weevil damage second evaluation (WED2):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(WED2)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("FRAW2", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(FRAW2)==0))[1]>0){
		cat("\n","There are no roots but there is data for root fiber second determination (FRAW2):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(FRAW2)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("SURAW2", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(SURAW2)==0))[1]>0){
		cat("\n","There are no roots but there is data for root sugar second determination (SURAW2):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(SURAW2)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("STRAW2", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(STRAW2)==0))[1]>0){
		cat("\n","There are no roots but there is data for root starch second determination (STRAW2):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(STRAW2)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("COOF2", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOF2)==0))[1]>0){
		cat("\n","There are no roots but there is data for cooked fiber second evaluation (COOF2):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOF2)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("COOSU2", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOSU2)==0))[1]>0){
		cat("\n","There are no roots but there is data for cooked sugars second evaluation (COOSU2):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOSU2)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("COOST2", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOST2)==0))[1]>0){
		cat("\n","There are no roots but there is data for cooked starch second evaluation (COOST2):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOST2)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("COOT2", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOT2)==0))[1]>0){
		cat("\n","There are no roots but there is data for cooked taste second evaluation (COOT2):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOT2)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("COOAP2", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOAP2)==0))[1]>0){
		cat("\n","There are no roots but there is data for cooked appearance second evaluation (COOAP2):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(COOAP2)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("RSPR", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(RSPR)==0))[1]>0){
		cat("\n","There are no roots but there is data for root sprouting (RSPR):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(RSPR)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("PROT", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(PROT)==0))[1]>0){
		cat("\n","There are no roots but there is data for protein (PROT):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(PROT)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("FE", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(FE)==0))[1]>0){
		cat("\n","There are no roots but there is data for iron in dry weight (FE):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(FE)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("ZN", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(ZN)==0))[1]>0){
		cat("\n","There are no roots but there is data for zinc in dry weight (ZN):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(ZN)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("CA", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(CA)==0))[1]>0){
		cat("\n","There are no roots but there is data for calcium in dry weight (CA):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(CA)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("MG", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(MG)==0))[1]>0){
		cat("\n","There are no roots but there is data for magnesium in dry weight (MG):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(MG)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("BC", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(BC)==0))[1]>0){
		cat("\n","There are no roots but there is data for beta-carotene in dry weight (BC):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(BC)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("TC", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(TC)==0))[1]>0){
		cat("\n","There are no roots but there is data for total carotenoids in dry weight (TC):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(TC)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("STAR", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(STAR)==0))[1]>0){
		cat("\n","There are no roots but there is data for starch (STAR):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(STAR)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("FRUC", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(FRUC)==0))[1]>0){
		cat("\n","There are no roots but there is data for fructose (FRUC):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(FRUC)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("GLUC", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(GLUC)==0))[1]>0){
		cat("\n","There are no roots but there is data for glucose (GLUC):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(GLUC)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("SUCR", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(SUCR)==0))[1]>0){
		cat("\n","There are no roots but there is data for sucrose (SUCR):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(SUCR)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("MALT", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(MALT)==0))[1]>0){
		cat("\n","There are no roots but there is data for maltose (MALT):","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & is.na(MALT)==0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("TRW", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & TRW>0))[1]>0){
		cat("\n","There are no roots but total root weight (TRW) is greater than zero:","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & TRW>0, select = -RAUX)
	}

if (exists("RAUX", where=datos)==1 & exists("RYTHA", where=datos)==1)
	if (dim(subset(datos, (RAUX==0 | is.na(RAUX)==1) & RYTHA>0))[1]>0){
		cat("\n","There are no roots but total root yield (RYTHA) is greater than zero:","\n")
		subset(datos, (RAUX==0 | is.na(RAUX)==1) & RYTHA>0, select = -RAUX)
	}

datos$RAUX <- NULL

## Calculated variables

if (exists("TRW", where=datos)==1 & exists("CRW", where=datos)==1 & exists("NCRW", where=datos)==1)
	if (dim(subset(datos, TRW!=apply(cbind(datos$CRW, datos$NCRW), 1, sum, na.rm=T)))[1]>0){
		cat("\n","Total root weight (TRW) different from CRW+NCRW:","\n")
		subset(datos, TRW!=apply(cbind(datos$CRW, datos$NCRW), 1, sum, na.rm=T))
	}

if (exists("CYTHA", where=datos)==1 & exists("CRW", where=datos)==1)
	if (dim(subset(datos, CYTHA!=CRW*10/plot.size))[1]>0){
		cat("\n","Commercial root yield in tons per hectare (CYTHA) is different from CRW*10/plot.size:","\n")
		subset(datos, CYTHA!=CRW*10/plot.size)
	}

if (exists("RYTHA", where=datos)==1 & exists("CRW", where=datos)==1 & exists("NCRW", where=datos)==1)
	if (dim(subset(datos, RYTHA!=apply(cbind(CRW,NCRW), 1, sum, na.rm=T)*10/plot.size))[1]>0){
		cat("\n","Total root yield in tons per hectare (RYTHA) is different from (CRW+NCRW)*10/plot.size:","\n")
		subset(datos, RYTHA!=apply(cbind(CRW,NCRW), 1, sum, na.rm=T)*10/plot.size)
	}

if (exists("ACRW", where=datos)==1 & exists("CRW", where=datos)==1 & exists("NOCR", where=datos)==1)
	if (dim(subset(datos, ACRW!=CRW/NOCR))[1]>0){
		cat("\n","Average commercial root weight (ACRW) is different from CRW/NOCR:","\n")
		subset(datos, ACRW!=CRW/NOCR)
	}

if (exists("NRPP", where=datos)==1 & exists("NOCR", where=datos)==1 & exists("NONC", where=datos)==1 & exists("NOPH", where=datos)==1)
	if (dim(subset(datos, NRPP!=apply(cbind(NOCR,NONC), 1, sum, na.rm=T)/NOPH))[1]>0){
		cat("\n","Number of roots per plant (NRPP) is different from (NOCR+NONC)/NOPH:","\n")
		subset(datos, NRPP!=apply(cbind(NOCR,NONC), 1, sum, na.rm=T)/NOPH)
	}

if (exists("YPP", where=datos)==1 & exists("CRW", where=datos)==1 & exists("NCRW", where=datos)==1 & exists("NOPH", where=datos)==1)
	if (dim(subset(datos, YPP!=apply(cbind(CRW, NCRW), 1, sum, na.rm=T)/NOPH))[1]>0){
		cat("\n","Yield per plant (YPP) is different from (CRW+NCRW)/NOPH:","\n")
		subset(datos, YPP!=apply(cbind(CRW, NCRW), 1, sum, na.rm=T)/NOPH)
	}

if (exists("CI", where=datos)==1 & exists("NOCR", where=datos)==1 & exists("NONC", where=datos)==1)
	if (dim(subset(datos, CI!=NOCR/apply(cbind(NOCR,NONC), 1, sum, na.rm=T)*100))[1]>0){
		cat("\n","Commercial index (CI) is different from NOCR/(NOCR+NONC)*100:","\n")
		subset(datos, CI!=NOCR/apply(cbind(NOCR,NONC), 1, sum, na.rm=T)*100)
	}

if (exists("HI", where=datos)==1 & exists("CRW", where=datos)==1 & exists("NCRW", where=datos)==1 & exists("VW", where=datos)==1)
	if (dim(subset(datos, HI!=apply(cbind(CRW, NCRW), 1, sum, na.rm=T)/apply(cbind(VW, CRW, NCRW), 1, sum, na.rm=T)*100))[1]>0){
		cat("\n","Harvest index (HI) is different from (CRW+NCRW)/(VW+CRW+NCRW)*100:","\n")
		subset(datos, HI!=apply(cbind(CRW, NCRW), 1, sum, na.rm=T)/apply(cbind(VW, CRW, NCRW), 1, sum, na.rm=T)*100)
	}

if (exists("SHI", where=datos)==1 & exists("NOPH", where=datos)==1 & exists("NOPS", where=datos)==1)
	if (dim(subset(datos, SHI!=NOPH/NOPS*100))[1]>0){
		cat("\n","Harvest sowing index (SHI) is different from NOPH/NOPS*100:","\n")
		subset(datos, SHI!=NOPH/NOPS*100)
	}

if (exists("BIOM", where=datos)==1 & exists("CRW", where=datos)==1 & exists("NCRW", where=datos)==1 & exists("VW", where=datos)==1)
	if (dim(subset(datos, BIOM!=apply(cbind(VW, CRW, NCRW), 1, sum, na.rm=T)*10/plot.size))[1]>0){
		cat("\n","Biomass yield (BIOM) is different from (CRW+NCRW+VW)*10/plot.size:","\n")
		subset(datos, BIOM!=apply(cbind(VW, CRW, NCRW), 1, sum, na.rm=T)*10/plot.size)
	}

if (exists("FYTHA", where=datos)==1 & exists("VW", where=datos)==1)
	if (dim(subset(datos, FYTHA!=VW*10/plot.size))[1]>0){
		cat("\n","Foliage total yield in tons per hectare (FYTHA) is different from VW*10/plot.size:","\n")
		subset(datos, FYTHA!=VW*10/plot.size)
	}

if (exists("DM", where=datos)==1 & exists("DMD", where=datos)==1 & exists("DMF", where=datos)==1)
	if (dim(subset(datos, DM!=DMD/DMF*100))[1]>0){
		cat("\n","Storage root dry matter content (DM) is different from DMD/DMF*100:","\n")
		subset(datos, DM!=DMD/DMF*100)
	}

if (exists("DMFY", where=datos)==1 & exists("VW", where=datos)==1 & exists("DMVD", where=datos)==1 & exists("DMVF", where=datos)==1)
	if (dim(subset(datos, DMFY!=VW*10/plot.size*DMVD/DMVF))[1]>0){
		cat("\n","Dry matter foliage yield (DMFY) is different from VW*10/plot.size*DMVD/DMVF:","\n")
		subset(datos, DMFY!=VW*10/plot.size*DMVD/DMVF)
	}

if (exists("DMRY", where=datos)==1 & exists("CRW", where=datos)==1 & exists("NCRW", where=datos)==1
		& exists("DMD", where=datos)==1 & exists("DMF", where=datos)==1)
	if (dim(subset(datos, DMRY!=apply(cbind(CRW, NCRW), 1, sum, na.rm=T)*10/plot.size*DMD/DMF))[1]>0){
		cat("\n","Dry matter root yield (DMRY) is different from (CRW+NCRW)*10/plot.size*DMD/DMF:","\n")
		subset(datos, DMRY!=apply(cbind(CRW, NCRW), 1, sum, na.rm=T)*10/plot.size*DMD/DMF)
	}

if (exists("RFR", where=datos)==1 & exists("CRW", where=datos)==1 & exists("NCRW", where=datos)==1 & exists("DMD", where=datos)==1
		& exists("DMF", where=datos)==1 & exists("VW", where=datos)==1 & exists("DMVD", where=datos)==1 & exists("DMVF", where=datos)==1)
	if (dim(subset(datos, RFR!=apply(cbind(CRW, NCRW), 1, sum, na.rm=T)*(DMD/DMF)/(VW*DMVD/DMVF)))[1]>0){
		cat("\n","Root foliage ratio (RFR) is different from (CRW+NCRW)*(DMD/DMF)/(VW*DMVD/DMVF)*100:","\n")
		subset(datos, RFR!=apply(cbind(CRW, NCRW), 1, sum, na.rm=T)*(DMD/DMF)/(VW*DMVD/DMVF))
	}

## Outliers detection based on interquartile range and values out of range

if (exists("VIR1", where=datos)==1)
	if (dim(subset(datos, VIR1 < 1 | VIR1 > 9 ))[1]>0){
		cat("\n","Out of range values for virus symptoms first evaluation (VIR1):","\n")
		subset(datos, VIR1 < 1 | VIR1 > 9)
	}

if (exists("VIR2", where=datos)==1)
	if (dim(subset(datos, VIR2 < 1 | VIR2 > 9 ))[1]>0){
		cat("\n","Out of range values for virus symptoms second evaluation (VIR2):","\n")
		subset(datos, VIR2 < 1 | VIR2 > 9)
	}

if (exists("ALT1", where=datos)==1)
	if (dim(subset(datos, ALT1 < 1 | ALT1 > 9 ))[1]>0){
		cat("\n","Out of range values for alternaria symptoms first evaluation (ALT1):","\n")
		subset(datos, ALT1 < 1 | ALT1 > 9)
	}

if (exists("ALT2", where=datos)==1)
	if (dim(subset(datos, ALT2 < 1 | ALT2 > 9 ))[1]>0){
		cat("\n","Out of range values for alternaria symptoms second evaluation (ALT2):","\n")
		subset(datos, ALT2 < 1 | ALT2 > 9)
	}

if (exists("VV1", where=datos)==1)
	if (dim(subset(datos, VV1 < 1 | VV1 > 9 ))[1]>0){
		cat("\n","Out of range values for vine vigor first evaluation (VV1):","\n")
		subset(datos, VV1 < 1 | VV1 > 9)
	}

if (exists("VW", where=datos)==1)
	if (dim(subset(datos, VW < quantile(VW, 0.25, na.rm=T)-3*IQR(VW, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for vine weight (VW):","\n")
		subset(datos, VW < quantile(VW, 0.25, na.rm=T)-3*IQR(VW, na.rm=T))
	}

if (exists("VW", where=datos)==1)
	if (dim(subset(datos, VW > quantile(VW, 0.75, na.rm=T)+3*IQR(VW, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for vine weight (VW):","\n")
		subset(datos, VW > quantile(VW, 0.75, na.rm=T)+3*IQR(VW, na.rm=T))
	}

if (exists("NOCR", where=datos)==1)
	if (dim(subset(datos, NOCR < quantile(NOCR, 0.25, na.rm=T)-3*IQR(NOCR, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for number of commercial roots (NOCR):","\n")
		subset(datos, NOCR < quantile(NOCR, 0.25, na.rm=T)-3*IQR(NOCR, na.rm=T))
	}

if (exists("NOCR", where=datos)==1)
	if (dim(subset(datos, NOCR > quantile(NOCR, 0.75, na.rm=T)+3*IQR(NOCR, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for number of commercial roots (NOCR):","\n")
		subset(datos, NOCR > quantile(NOCR, 0.75, na.rm=T)+3*IQR(NOCR, na.rm=T))
	}

if (exists("NONC", where=datos)==1)
	if (dim(subset(datos, NONC < quantile(NONC, 0.25, na.rm=T)-3*IQR(NONC, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for number of non commercial roots (NONC):","\n")
		subset(datos, NONC < quantile(NONC, 0.25, na.rm=T)-3*IQR(NONC, na.rm=T))
	}

if (exists("NONC", where=datos)==1)
	if (dim(subset(datos, NONC > quantile(NONC, 0.75, na.rm=T)+3*IQR(NONC, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for number of non commercial roots (NONC):","\n")
		subset(datos, NONC > quantile(NONC, 0.75, na.rm=T)+3*IQR(NONC, na.rm=T))
	}

if (exists("CRW", where=datos)==1)
	if (dim(subset(datos, CRW < quantile(CRW, 0.25, na.rm=T)-3*IQR(CRW, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for commercial root weight (CRW):","\n")
		subset(datos, CRW < quantile(CRW, 0.25, na.rm=T)-3*IQR(CRW, na.rm=T))
	}

if (exists("CRW", where=datos)==1)
	if (dim(subset(datos, CRW > quantile(CRW, 0.75, na.rm=T)+3*IQR(CRW, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for commercial root weight (CRW):","\n")
		subset(datos, CRW > quantile(CRW, 0.75, na.rm=T)+3*IQR(CRW, na.rm=T))
	}

if (exists("NCRW", where=datos)==1)
	if (dim(subset(datos, NCRW < quantile(NCRW, 0.25, na.rm=T)-3*IQR(NCRW, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for non commercial root weight (NCRW):","\n")
		subset(datos, NCRW < quantile(NCRW, 0.25, na.rm=T)-3*IQR(NCRW, na.rm=T))
	}

if (exists("NCRW", where=datos)==1)
	if (dim(subset(datos, NCRW > quantile(NCRW, 0.75, na.rm=T)+3*IQR(NCRW, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for non commercial root weight (NCRW):","\n")
		subset(datos, NCRW > quantile(NCRW, 0.75, na.rm=T)+3*IQR(NCRW, na.rm=T))
	}

if (exists("SCOL", where=datos)==1)
	if (dim(subset(datos, SCOL < 1 | SCOL > 9 ))[1]>0){
		cat("\n","Out of range values for storage root skin color (SCOL):","\n")
		subset(datos, SCOL < 1 | SCOL > 9)
	}

if (exists("FCOL", where=datos)==1)
	if (dim(subset(datos, FCOL < 1 | FCOL > 9 ))[1]>0){
		cat("\n","Out of range values for storage root flesh color (FCOL):","\n")
		subset(datos, FCOL < 1 | FCOL > 9)
	}

if (exists("RS", where=datos)==1)
	if (dim(subset(datos, RS < 1 | RS > 9 ))[1]>0){
		cat("\n","Out of range values for root size (RS):","\n")
		subset(datos, RS < 1 | RS > 9)
	}

if (exists("RF", where=datos)==1)
	if (dim(subset(datos, RF < 1 | RF > 9 ))[1]>0){
		cat("\n","Out of range values for root form (RF):","\n")
		subset(datos, RF < 1 | RF > 9)
	}

if (exists("DAMR", where=datos)==1)
	if (dim(subset(datos, DAMR < 1 | DAMR > 9 ))[1]>0){
		cat("\n","Out of range values for root defects (DAMR):","\n")
		subset(datos, DAMR < 1 | DAMR > 9)
	}

if (exists("WED1", where=datos)==1)
	if (dim(subset(datos, WED1 < 1 | WED1 > 9 ))[1]>0){
		cat("\n","Out of range values for weevil damage first evaluation (WED1):","\n")
		subset(datos, WED1 < 1 | WED1 > 9)
	}

if (exists("DMF", where=datos)==1)
	if (dim(subset(datos, DMF < quantile(DMF, 0.25, na.rm=T)-3*IQR(DMF, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for fresh weight of roots for dry matter assessment (DMF):","\n")
		subset(datos, DMF < quantile(DMF, 0.25, na.rm=T)-3*IQR(DMF, na.rm=T))
	}

if (exists("DMF", where=datos)==1)
	if (dim(subset(datos, DMF > quantile(DMF, 0.75, na.rm=T)+3*IQR(DMF, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for fresh weight of roots for dry matter assessment (DMF):","\n")
		subset(datos, DMF > quantile(DMF, 0.75, na.rm=T)+3*IQR(DMF, na.rm=T))
	}

if (exists("DMD", where=datos)==1)
	if (dim(subset(datos, DMD < quantile(DMD, 0.25, na.rm=T)-3*IQR(DMD, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for dry weight of roots for dry matter assessment (DMD):","\n")
		subset(datos, DMD < quantile(DMD, 0.25, na.rm=T)-3*IQR(DMD, na.rm=T))
	}

if (exists("DMD", where=datos)==1)
	if (dim(subset(datos, DMD > quantile(DMD, 0.75, na.rm=T)+3*IQR(DMD, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for dry weight of roots for dry matter assessment (DMD):","\n")
		subset(datos, DMD > quantile(DMD, 0.75, na.rm=T)+3*IQR(DMD, na.rm=T))
	}

if (exists("FRAW1", where=datos)==1)
	if (dim(subset(datos, FRAW1 < 1 | FRAW1 > 9 ))[1]>0){
		cat("\n","Out of range values for root fiber first determination (FRAW1):","\n")
		subset(datos, FRAW1 < 1 | FRAW1 > 9)
	}

if (exists("SURAW1", where=datos)==1)
	if (dim(subset(datos, SURAW1 < 1 | SURAW1 > 9 ))[1]>0){
		cat("\n","Out of range values for root sugar first determination (SURAW1):","\n")
		subset(datos, SURAW1 < 1 | SURAW1 > 9)
	}

if (exists("STRAW1", where=datos)==1)
	if (dim(subset(datos, STRAW1 < 1 | STRAW1 > 9 ))[1]>0){
		cat("\n","Out of range values for root starch first determination (STRAW1):","\n")
		subset(datos, STRAW1 < 1 | STRAW1 > 9)
	}

if (exists("COOF1", where=datos)==1)
	if (dim(subset(datos, COOF1 < 1 | COOF1 > 9 ))[1]>0){
		cat("\n","Out of range values for cooked fiber first evaluation (COOF1):","\n")
		subset(datos, COOF1 < 1 | COOF1 > 9)
	}

if (exists("COOSU1", where=datos)==1)
	if (dim(subset(datos, COOSU1 < 1 | COOSU1 > 9 ))[1]>0){
		cat("\n","Out of range values for cooked sugars first evaluation (COOSU1):","\n")
		subset(datos, COOSU1 < 1 | COOSU1 > 9)
	}

if (exists("COOST1", where=datos)==1)
	if (dim(subset(datos, COOST1 < 1 | COOST1 > 9 ))[1]>0){
		cat("\n","Out of range values for cooked starch first evaluation (COOST1):","\n")
		subset(datos, COOST1 < 1 | COOST1 > 9)
	}

if (exists("COOT1", where=datos)==1)
	if (dim(subset(datos, COOT1 < 1 | COOT1 > 9 ))[1]>0){
		cat("\n","Out of range values for cooked taste first evaluation (COOT1):","\n")
		subset(datos, COOT1 < 1 | COOT1 > 9)
	}

if (exists("COOAP1", where=datos)==1)
	if (dim(subset(datos, COOAP1 < 1 | COOAP1 > 9 ))[1]>0){
		cat("\n","Out of range values for cooked appearance first evaluation (COOAP1):","\n")
		subset(datos, COOAP1 < 1 | COOAP1 > 9)
	}

if (exists("VV2", where=datos)==1)
	if (dim(subset(datos, VV2 < 1 | VV2 > 9 ))[1]>0){
		cat("\n","Out of range values for vine vigor second evaluation (VV2):","\n")
		subset(datos, VV2 < 1 | VV2 > 9)
	}

if (exists("VIR3", where=datos)==1)
	if (dim(subset(datos, VIR3 < 1 | VIR3 > 9 ))[1]>0){
		cat("\n","Out of range values for virus symptoms third evaluation (VIR3):","\n")
		subset(datos, VIR3 < 1 | VIR3 > 9)
	}

if (exists("WED2", where=datos)==1)
	if (dim(subset(datos, WED2 < 1 | WED2 > 9 ))[1]>0){
		cat("\n","Out of range values for weevil damage second evaluation (WED2):","\n")
		subset(datos, WED2 < 1 | WED2 > 9)
	}

if (exists("FRAW2", where=datos)==1)
	if (dim(subset(datos, FRAW2 < 1 | FRAW2 > 9 ))[1]>0){
		cat("\n","Out of range values for root fiber second determination (FRAW2):","\n")
		subset(datos, FRAW2 < 1 | FRAW2 > 9)
	}

if (exists("SURAW2", where=datos)==1)
	if (dim(subset(datos, SURAW2 < 1 | SURAW2 > 9 ))[1]>0){
		cat("\n","Out of range values for root sugar second determination (SURAW2):","\n")
		subset(datos, SURAW2 < 1 | SURAW2 > 9)
	}

if (exists("STRAW2", where=datos)==1)
	if (dim(subset(datos, STRAW2 < 1 | STRAW2 > 9 ))[1]>0){
		cat("\n","Out of range values for root starch second determination (STRAW2):","\n")
		subset(datos, STRAW2 < 1 | STRAW2 > 9)
	}

if (exists("COOF2", where=datos)==1)
	if (dim(subset(datos, COOF2 < 1 | COOF2 > 9 ))[1]>0){
		cat("\n","Out of range values for cooked fiber second evaluation (COOF2):","\n")
		subset(datos, COOF2 < 1 | COOF2 > 9)
	}

if (exists("COOSU2", where=datos)==1)
	if (dim(subset(datos, COOSU2 < 1 | COOSU2 > 9 ))[1]>0){
		cat("\n","Out of range values for cooked sugars second evaluation (COOSU2):","\n")
		subset(datos, COOSU2 < 1 | COOSU2 > 9)
	}

if (exists("COOST2", where=datos)==1)
	if (dim(subset(datos, COOST2 < 1 | COOST2 > 9 ))[1]>0){
		cat("\n","Out of range values for cooked starch second evaluation (COOST2):","\n")
		subset(datos, COOST2 < 1 | COOST2 > 9)
	}

if (exists("COOT2", where=datos)==1)
	if (dim(subset(datos, COOT2 < 1 | COOT2 > 9 ))[1]>0){
		cat("\n","Out of range values for cooked taste second evaluation (COOT2):","\n")
		subset(datos, COOT2 < 1 | COOT2 > 9)
	}

if (exists("COOAP2", where=datos)==1)
	if (dim(subset(datos, COOAP2 < 1 | COOAP2 > 9 ))[1]>0){
		cat("\n","Out of range values for cooked appearance second evaluation (COOAP2):","\n")
		subset(datos, COOAP2 < 1 | COOAP2 > 9)
	}

if (exists("RSPR", where=datos)==1)
	if (dim(subset(datos, RSPR < 1 | RSPR > 9 ))[1]>0){
		cat("\n","Out of range values for root sprouting (RSPR):","\n")
		subset(datos, RSPR < 1 | RSPR > 9)
	}

if (exists("DMVF", where=datos)==1)
	if (dim(subset(datos, DMVF < quantile(DMVF, 0.25, na.rm=T)-3*IQR(DMVF, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for fresh weight of vines for dry matter assessment (DMVF):","\n")
		subset(datos, DMVF < quantile(DMVF, 0.25, na.rm=T)-3*IQR(DMVF, na.rm=T))
	}

if (exists("DMVF", where=datos)==1)
	if (dim(subset(datos, DMVF > quantile(DMVF, 0.75, na.rm=T)+3*IQR(DMVF, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for fresh weight of vines for dry matter assessment (DMVF):","\n")
		subset(datos, DMVF > quantile(DMVF, 0.75, na.rm=T)+3*IQR(DMVF, na.rm=T))
	}

if (exists("DMVD", where=datos)==1)
	if (dim(subset(datos, DMVD < quantile(DMVD, 0.25, na.rm=T)-3*IQR(DMVD, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for dry weight of vines for dry matter assessment (DMVD):","\n")
		subset(datos, DMVD < quantile(DMVD, 0.25, na.rm=T)-3*IQR(DMVD, na.rm=T))
	}

if (exists("DMVD", where=datos)==1)
	if (dim(subset(datos, DMVD > quantile(DMVD, 0.75, na.rm=T)+3*IQR(DMVD, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for dry weight of vines for dry matter assessment (DMVD):","\n")
		subset(datos, DMVD > quantile(DMVD, 0.75, na.rm=T)+3*IQR(DMVD, na.rm=T))
	}

if (exists("PROT", where=datos)==1)
	if (dim(subset(datos, PROT < quantile(PROT, 0.25, na.rm=T)-3*IQR(PROT, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for protein (PROT):","\n")
		subset(datos, PROT < quantile(PROT, 0.25, na.rm=T)-3*IQR(PROT, na.rm=T))
	}

if (exists("PROT", where=datos)==1)
	if (dim(subset(datos, PROT > quantile(PROT, 0.75, na.rm=T)+3*IQR(PROT, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for protein (PROT):","\n")
		subset(datos, PROT > quantile(PROT, 0.75, na.rm=T)+3*IQR(PROT, na.rm=T))
	}
		
if (exists("FE", where=datos)==1)
	if (dim(subset(datos, FE < quantile(FE, 0.25, na.rm=T)-3*IQR(FE, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for iron in dry weight (FE):","\n")
		subset(datos, FE < quantile(FE, 0.25, na.rm=T)-3*IQR(FE, na.rm=T))
	}

if (exists("FE", where=datos)==1)
	if (dim(subset(datos, FE > quantile(FE, 0.75, na.rm=T)+3*IQR(FE, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for iron in dry weight (FE):","\n")
		subset(datos, FE > quantile(FE, 0.75, na.rm=T)+3*IQR(FE, na.rm=T))
	}

if (exists("ZN", where=datos)==1)
	if (dim(subset(datos, ZN < quantile(ZN, 0.25, na.rm=T)-3*IQR(ZN, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for zinc in dry weight (ZN):","\n")
		subset(datos, ZN < quantile(ZN, 0.25, na.rm=T)-3*IQR(ZN, na.rm=T))
	}

if (exists("ZN", where=datos)==1)
	if (dim(subset(datos, ZN > quantile(ZN, 0.75, na.rm=T)+3*IQR(ZN, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for zinc in dry weight (ZN):","\n")
		subset(datos, ZN > quantile(ZN, 0.75, na.rm=T)+3*IQR(ZN, na.rm=T))
	}

if (exists("CA", where=datos)==1)
	if (dim(subset(datos, CA < quantile(CA, 0.25, na.rm=T)-3*IQR(CA, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for calcium in dry weight (CA):","\n")
		subset(datos, CA < quantile(CA, 0.25, na.rm=T)-3*IQR(CA, na.rm=T))
	}

if (exists("CA", where=datos)==1)
	if (dim(subset(datos, CA > quantile(CA, 0.75, na.rm=T)+3*IQR(CA, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for calcium in dry weight (CA):","\n")
		subset(datos, CA > quantile(CA, 0.75, na.rm=T)+3*IQR(CA, na.rm=T))
	}

if (exists("MG", where=datos)==1)
	if (dim(subset(datos, MG < quantile(MG, 0.25, na.rm=T)-3*IQR(MG, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for magnesium in dry weight (MG):","\n")
		subset(datos, MG < quantile(MG, 0.25, na.rm=T)-3*IQR(MG, na.rm=T))
	}

if (exists("MG", where=datos)==1)
	if (dim(subset(datos, MG > quantile(MG, 0.75, na.rm=T)+3*IQR(MG, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for magnesium in dry weight (MG):","\n")
		subset(datos, MG > quantile(MG, 0.75, na.rm=T)+3*IQR(MG, na.rm=T))
	}

if (exists("BC", where=datos)==1)
	if (dim(subset(datos, BC < quantile(BC, 0.25, na.rm=T)-3*IQR(BC, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for beta-carotene in dry weight (BC):","\n")
		subset(datos, BC < quantile(BC, 0.25, na.rm=T)-3*IQR(BC, na.rm=T))
	}

if (exists("BC", where=datos)==1)
	if (dim(subset(datos, BC > quantile(BC, 0.75, na.rm=T)+3*IQR(BC, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for beta-carotene in dry weight (BC):","\n")
		subset(datos, BC > quantile(BC, 0.75, na.rm=T)+3*IQR(BC, na.rm=T))
	}

if (exists("TC", where=datos)==1)
	if (dim(subset(datos, TC < quantile(TC, 0.25, na.rm=T)-3*IQR(TC, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for total carotenoids in dry weight (TC):","\n")
		subset(datos, TC < quantile(TC, 0.25, na.rm=T)-3*IQR(TC, na.rm=T))
	}

if (exists("TC", where=datos)==1)
	if (dim(subset(datos, TC > quantile(TC, 0.75, na.rm=T)+3*IQR(TC, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for total carotenoids in dry weight (TC):","\n")
		subset(datos, TC > quantile(TC, 0.75, na.rm=T)+3*IQR(TC, na.rm=T))
	}

if (exists("STAR", where=datos)==1)
	if (dim(subset(datos, STAR < quantile(STAR, 0.25, na.rm=T)-3*IQR(STAR, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for starch (STAR):","\n")
		subset(datos, STAR < quantile(STAR, 0.25, na.rm=T)-3*IQR(STAR, na.rm=T))
	}

if (exists("STAR", where=datos)==1)
	if (dim(subset(datos, STAR > quantile(STAR, 0.75, na.rm=T)+3*IQR(STAR, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for starch (STAR):","\n")
		subset(datos, STAR > quantile(STAR, 0.75, na.rm=T)+3*IQR(STAR, na.rm=T))
	}
		
if (exists("FRUC", where=datos)==1)
	if (dim(subset(datos, FRUC < quantile(FRUC, 0.25, na.rm=T)-3*IQR(FRUC, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for fructose (FRUC):","\n")
		subset(datos, FRUC < quantile(FRUC, 0.25, na.rm=T)-3*IQR(FRUC, na.rm=T))
	}

if (exists("FRUC", where=datos)==1)
	if (dim(subset(datos, FRUC > quantile(FRUC, 0.75, na.rm=T)+3*IQR(FRUC, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for fructose (FRUC):","\n")
		subset(datos, FRUC > quantile(FRUC, 0.75, na.rm=T)+3*IQR(FRUC, na.rm=T))
	}
		
if (exists("GLUC", where=datos)==1)
	if (dim(subset(datos, GLUC < quantile(GLUC, 0.25, na.rm=T)-3*IQR(GLUC, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for glucose (GLUC):","\n")
		subset(datos, GLUC < quantile(GLUC, 0.25, na.rm=T)-3*IQR(GLUC, na.rm=T))
	}

if (exists("GLUC", where=datos)==1)
	if (dim(subset(datos, GLUC > quantile(GLUC, 0.75, na.rm=T)+3*IQR(GLUC, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for glucose (GLUC):","\n")
		subset(datos, GLUC > quantile(GLUC, 0.75, na.rm=T)+3*IQR(GLUC, na.rm=T))
	}

if (exists("SUCR", where=datos)==1)
	if (dim(subset(datos, SUCR < quantile(SUCR, 0.25, na.rm=T)-3*IQR(SUCR, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for sucrose (SUCR):","\n")
		subset(datos, SUCR < quantile(SUCR, 0.25, na.rm=T)-3*IQR(SUCR, na.rm=T))
	}

if (exists("SUCR", where=datos)==1)
	if (dim(subset(datos, SUCR > quantile(SUCR, 0.75, na.rm=T)+3*IQR(SUCR, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for sucrose (SUCR):","\n")
		subset(datos, SUCR > quantile(SUCR, 0.75, na.rm=T)+3*IQR(SUCR, na.rm=T))
	}

if (exists("MALT", where=datos)==1)
	if (dim(subset(datos, MALT < quantile(MALT, 0.25, na.rm=T)-3*IQR(MALT, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for maltose (MALT):","\n")
		subset(datos, MALT < quantile(MALT, 0.25, na.rm=T)-3*IQR(MALT, na.rm=T))
	}

if (exists("MALT", where=datos)==1)
	if (dim(subset(datos, MALT > quantile(MALT, 0.75, na.rm=T)+3*IQR(MALT, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for maltose (MALT):","\n")
		subset(datos, MALT > quantile(MALT, 0.75, na.rm=T)+3*IQR(MALT, na.rm=T))
	}

if (exists("TRW", where=datos)==1)
	if (dim(subset(datos, TRW < quantile(TRW, 0.25, na.rm=T)-3*IQR(TRW, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for total root weight (TRW):","\n")
		subset(datos, TRW < quantile(TRW, 0.25, na.rm=T)-3*IQR(TRW, na.rm=T))
	}

if (exists("TRW", where=datos)==1)
	if (dim(subset(datos, TRW > quantile(TRW, 0.75, na.rm=T)+3*IQR(TRW, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for total root weight (TRW):","\n")
		subset(datos, TRW > quantile(TRW, 0.75, na.rm=T)+3*IQR(TRW, na.rm=T))
	}

if (exists("CYTHA", where=datos)==1)
	if (dim(subset(datos, CYTHA < quantile(CYTHA, 0.25, na.rm=T)-3*IQR(CYTHA, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for commercial root yield in tons per hectare (CYTHA):","\n")
		subset(datos, CYTHA < quantile(CYTHA, 0.25, na.rm=T)-3*IQR(CYTHA, na.rm=T))
	}

if (exists("CYTHA", where=datos)==1)
	if (dim(subset(datos, CYTHA > quantile(CYTHA, 0.75, na.rm=T)+3*IQR(CYTHA, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for commercial root yield in tons per hectare (CYTHA):","\n")
		subset(datos, CYTHA > quantile(CYTHA, 0.75, na.rm=T)+3*IQR(CYTHA, na.rm=T))
	}

if (exists("RYTHA", where=datos)==1)
	if (dim(subset(datos, RYTHA < quantile(RYTHA, 0.25, na.rm=T)-3*IQR(RYTHA, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for total root yield in tons per hectare (RYTHA):","\n")
		subset(datos, RYTHA < quantile(RYTHA, 0.25, na.rm=T)-3*IQR(RYTHA, na.rm=T))
	}

if (exists("RYTHA", where=datos)==1)
	if (dim(subset(datos, RYTHA > quantile(RYTHA, 0.75, na.rm=T)+3*IQR(RYTHA, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for total root yield in tons per hectare (RYTHA):","\n")
		subset(datos, RYTHA > quantile(RYTHA, 0.75, na.rm=T)+3*IQR(RYTHA, na.rm=T))
	}
	
if (exists("ACRW", where=datos)==1)
	if (dim(subset(datos, ACRW < quantile(ACRW, 0.25, na.rm=T)-3*IQR(ACRW, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for average commercial root weight (ACRW):","\n")
		subset(datos, ACRW < quantile(ACRW, 0.25, na.rm=T)-3*IQR(ACRW, na.rm=T))
	}

if (exists("ACRW", where=datos)==1)
	if (dim(subset(datos, ACRW > quantile(ACRW, 0.75, na.rm=T)+3*IQR(ACRW, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for average commercial root weight (ACRW):","\n")
		subset(datos, ACRW > quantile(ACRW, 0.75, na.rm=T)+3*IQR(ACRW, na.rm=T))
	}

if (exists("NRPP", where=datos)==1)
	if (dim(subset(datos, NRPP < quantile(NRPP, 0.25, na.rm=T)-3*IQR(NRPP, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for number of roots per plant (NRPP):","\n")
		subset(datos, NRPP < quantile(NRPP, 0.25, na.rm=T)-3*IQR(NRPP, na.rm=T))
	}

if (exists("NRPP", where=datos)==1)
	if (dim(subset(datos, NRPP > quantile(NRPP, 0.75, na.rm=T)+3*IQR(NRPP, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for number of roots per plant (NRPP):","\n")
		subset(datos, NRPP > quantile(NRPP, 0.75, na.rm=T)+3*IQR(NRPP, na.rm=T))
	}

if (exists("YPP", where=datos)==1)
	if (dim(subset(datos, YPP < quantile(YPP, 0.25, na.rm=T)-3*IQR(YPP, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for yield per plant (YPP):","\n")
		subset(datos, YPP < quantile(YPP, 0.25, na.rm=T)-3*IQR(YPP, na.rm=T))
	}

if (exists("YPP", where=datos)==1)
	if (dim(subset(datos, YPP > quantile(YPP, 0.75, na.rm=T)+3*IQR(YPP, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for yield per plant (YPP):","\n")
		subset(datos, YPP > quantile(YPP, 0.75, na.rm=T)+3*IQR(YPP, na.rm=T))
	}

if (exists("CI", where=datos)==1)
	if (dim(subset(datos, CI < quantile(CI, 0.25, na.rm=T)-3*IQR(CI, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for commercial index (CI):","\n")
		subset(datos, CI < quantile(CI, 0.25, na.rm=T)-3*IQR(CI, na.rm=T))
	}

if (exists("CI", where=datos)==1)
	if (dim(subset(datos, CI > quantile(CI, 0.75, na.rm=T)+3*IQR(CI, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for commercial index (CI):","\n")
		subset(datos, CI > quantile(CI, 0.75, na.rm=T)+3*IQR(CI, na.rm=T))
	}

if (exists("HI", where=datos)==1)
	if (dim(subset(datos, HI < quantile(HI, 0.25, na.rm=T)-3*IQR(HI, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for harvest index (HI):","\n")
		subset(datos, HI < quantile(HI, 0.25, na.rm=T)-3*IQR(HI, na.rm=T))
	}

if (exists("HI", where=datos)==1)
	if (dim(subset(datos, HI > quantile(HI, 0.75, na.rm=T)+3*IQR(HI, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for harvest index (HI):","\n")
		subset(datos, HI > quantile(HI, 0.75, na.rm=T)+3*IQR(HI, na.rm=T))
	}

if (exists("SHI", where=datos)==1)
	if (dim(subset(datos, SHI < quantile(SHI, 0.25, na.rm=T)-3*IQR(SHI, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for harvest sowing index (SHI):","\n")
		subset(datos, SHI < quantile(SHI, 0.25, na.rm=T)-3*IQR(SHI, na.rm=T))
	}

if (exists("SHI", where=datos)==1)
	if (dim(subset(datos, SHI > quantile(SHI, 0.75, na.rm=T)+3*IQR(SHI, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for harvest sowing index (SHI):","\n")
		subset(datos, SHI > quantile(SHI, 0.75, na.rm=T)+3*IQR(SHI, na.rm=T))
	}	
	
if (exists("BIOM", where=datos)==1)
	if (dim(subset(datos, BIOM < quantile(BIOM, 0.25, na.rm=T)-3*IQR(BIOM, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for biomass yield (BIOM):","\n")
		subset(datos, BIOM < quantile(BIOM, 0.25, na.rm=T)-3*IQR(BIOM, na.rm=T))
	}

if (exists("BIOM", where=datos)==1)
	if (dim(subset(datos, BIOM > quantile(BIOM, 0.75, na.rm=T)+3*IQR(BIOM, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for biomass yield (BIOM):","\n")
		subset(datos, BIOM > quantile(BIOM, 0.75, na.rm=T)+3*IQR(BIOM, na.rm=T))
	}	

if (exists("FYTHA", where=datos)==1)
	if (dim(subset(datos, FYTHA < quantile(FYTHA, 0.25, na.rm=T)-3*IQR(FYTHA, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for foliage total yield in tons per hectare (FYTHA):","\n")
		subset(datos, FYTHA < quantile(FYTHA, 0.25, na.rm=T)-3*IQR(FYTHA, na.rm=T))
	}

if (exists("FYTHA", where=datos)==1)
	if (dim(subset(datos, FYTHA > quantile(FYTHA, 0.75, na.rm=T)+3*IQR(FYTHA, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for foliage total yield in tons per hectare (FYTHA):","\n")
		subset(datos, FYTHA > quantile(FYTHA, 0.75, na.rm=T)+3*IQR(FYTHA, na.rm=T))
	}	

if (exists("DM", where=datos)==1)
	if (dim(subset(datos, DM < quantile(DM, 0.25, na.rm=T)-3*IQR(DM, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for storage root dry matter content (DM):","\n")
		subset(datos, DM < quantile(DM, 0.25, na.rm=T)-3*IQR(DM, na.rm=T))
	}

if (exists("DM", where=datos)==1)
	if (dim(subset(datos, DM > quantile(DM, 0.75, na.rm=T)+3*IQR(DM, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for storage root dry matter content (DM):","\n")
		subset(datos, DM > quantile(DM, 0.75, na.rm=T)+3*IQR(DM, na.rm=T))
	}	

if (exists("DMFY", where=datos)==1)
	if (dim(subset(datos, DMFY < quantile(DMFY, 0.25, na.rm=T)-3*IQR(DMFY, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for dry matter foliage yield (DMFY):","\n")
		subset(datos, DMFY < quantile(DMFY, 0.25, na.rm=T)-3*IQR(DMFY, na.rm=T))
	}

if (exists("DMFY", where=datos)==1)
	if (dim(subset(datos, DMFY > quantile(DMFY, 0.75, na.rm=T)+3*IQR(DMFY, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for dry matter foliage yield (DMFY):","\n")
		subset(datos, DMFY > quantile(DMFY, 0.75, na.rm=T)+3*IQR(DMFY, na.rm=T))
	}	

if (exists("DMRY", where=datos)==1)
	if (dim(subset(datos, DMRY < quantile(DMRY, 0.25, na.rm=T)-3*IQR(DMRY, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for dry matter root yield (DMRY):","\n")
		subset(datos, DMRY < quantile(DMRY, 0.25, na.rm=T)-3*IQR(DMRY, na.rm=T))
	}

if (exists("DMRY", where=datos)==1)
	if (dim(subset(datos, DMRY > quantile(DMRY, 0.75, na.rm=T)+3*IQR(DMRY, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for dry matter root yield (DMRY):","\n")
		subset(datos, DMRY > quantile(DMRY, 0.75, na.rm=T)+3*IQR(DMRY, na.rm=T))
	}	

if (exists("RFR", where=datos)==1)
	if (dim(subset(datos, RFR < quantile(RFR, 0.25, na.rm=T)-3*IQR(RFR, na.rm=T)))[1]>0){
		cat("\n","Extreme low values for root foliage ratio (RFR):","\n")
		subset(datos, RFR < quantile(RFR, 0.25, na.rm=T)-3*IQR(RFR, na.rm=T))
	}

if (exists("RFR", where=datos)==1)
	if (dim(subset(datos, RFR > quantile(RFR, 0.75, na.rm=T)+3*IQR(RFR, na.rm=T)))[1]>0){
		cat("\n","Extreme high values for root foliage ratio (RFR):","\n")
		subset(datos, RFR > quantile(RFR, 0.75, na.rm=T)+3*IQR(RFR, na.rm=T))
	}	

sink()
c5sire/GTDMS documentation built on May 13, 2019, 9:56 a.m.