#' Return the highest 5 cards
#'
#' @param cards A list of objects from the S4 class 'card'.
#'
#' @return A list containing the highest 5 cards.
#' @export
#'
#' @examples
high_cards <- function(cards){
values <- c()
for ( i in 1:length(cards)){
values <- c(values,cards[[i]]@value)
}
names(values) <- paste(1:length(cards))
values <- sort(values,decreasing=TRUE)
top_cards <- names(values)[1:5] %>% as.numeric() %>% cards[.]
return(cards)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.