str_rep_pos_neg_char = function( char ){
if( char == "+" ) return( "p" )
if( char == "-" ) return( "n" )
char
}
str_rep_pos_neg_string = function( string ){
laply( str_split( string, "", simplify = TRUE ), function( char ) str_rep_pos_neg_char( char ) ) %>%
str_c( collapse = "")
}
#' @export
str_rep_pos_neg = function( string ){
laply( string, function( x ) str_rep_pos_neg_string( x ) )
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.