#'@title Empirical variance-covariance kernels
#'
#'
#' @description Creates an empirical environmental kernel using environmental covariates
#' @author Germano Martins F Costa Neto <germano.cneto@usp.br>
#' @param .dfcov matrix of environmental covariates
#' @keywords genomic prediction
#' @seealso BGGE
#' @seealso envK
envKernel =function(.dfcov){
if(is.null(.dfcov)){stop("matrix of environmental covariates is missing")}
if(!is.data.frame(.dfcov)){stop(",dfcov must to be a matrix file")}
O <- tcrossprod(.dfcov)/ncol(.dfcov)
H <- crossprod(.dfcov)/nrow(.dfcov)
O <- O +diag(1E-4,nrow=nrow(.dfcov))
H <- H +diag(1E-4,nrow=ncol(.dfcov)
return(list(H=H,O=O))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.