state_to_abbreviation <- function(state)
{
data(mapping)
abbreviation <- with(subset(mapping, State == state), Abbreviation)
if (length(abbreviation) > 0)
{
return(abbreviation)
}
else
{
return(NA)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.