#' @title
#' Select a first name
#'
#' @description
#' Selects a name from the za_names dataset according to the
#' specified sex.
#'
#' @param sex Specify which sex the name is required for. Default value is \emph{"female"}, options include: \emph{"female"} or \emph{"male"}.
#'
#' @return a first name (character)
#'
#' @examples
#' give_name()
#'
#' @export
give_name <- function(sex = 'female') {
possible_names <- sa_names$first_name[sa_names$sex == sex]
sample(possible_names, size = 1)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.