#' Retrieve cards of specified suit.
#'
#' @param cards A list of objects of the S4 class `card`.
#' @param suit A string of the name of the suit to retain.
#' The first letter must be a capital.
#'
#' @return A list containing all cards of the specified suit.
#' @export
#'
get_suit <- function(cards,suit){
n <- length(cards)
remove <- c()
for (i in 1:n){
if (cards[[i]]@suit != suit) remove <- c(remove,i)
}
if(!is.null(remove[1])) cards <- cards[-remove]
return(cards)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.