Nothing
#' @rdname pcps
#' @encoding UTF-8
#' @export
summary.pcps <- function(object, choices = c(1, 2), ...){
if (length(choices) != 2) {
stop("\n Choices must have length equal to two \n")
}
if(is.null(object$correlations)){
object$correlations <- stats::cor(object$P, object$vectors)
}
res <- object
max1 <- max(object$vectors[, choices[1]])
max2 <- max(object$vectors[, choices[2]])
min1 <- min(object$vectors[, choices[1]])
min2 <- min(object$vectors[, choices[2]])
scores1 <- ifelse(object$correlations[,choices[1]]>0, object$correlations[,choices[1]]*max1, object$correlations[,choices[1]]*abs(min1))
scores2 <- ifelse(object$correlations[,choices[2]]>0, object$correlations[,choices[2]]*max2, object$correlations[,choices[2]]*abs(min2))
rscores <- data.frame(scores1, scores2)
colnames(rscores) <- colnames(object$vectors[, choices])
res$scores <- list(scores.sites = object$vectors[, choices], scores.species = rscores)
class(res) <- "summarypcps"
return(res)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.