#' Get PC1 and PC2 of input data frame.
#' 
#' Calculate first two PCs and return a data frame
#'
#' @param df An input data frame
#' @return A data frame where first column is a vector representing PC1, while second column is a vector representing PC2
#' @export
#'
getPC1andPC2 <- function(df){
  o <- as.data.frame(matrix(ncol = 2, nrow = ncol(df)))
  SVD <- svd(df - rowMeans(df))
  o[,1] <- SVD$v[,1]
  o[,2] <- SVD$v[,2]
  colnames(o) <- c("PC1", "PC2")
  row.names(o) <- colnames(df)
  return(o)
} 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.