#' Normalize rows function
#'
#' Normalizes rows for diversity calculations
#' @keywords jost
#' @export
#' @examples
#' normalize_rows()
normalize_rows <- function(com.matrix){
row.totals <- rowSums(com.matrix)
com.matrix <- as.matrix(com.matrix)
for(i in 1:nrow(com.matrix)){
com.matrix[i, ] <- com.matrix[i, ] / row.totals[i]
}
return(com.matrix)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.