Title: | Symbols for 'Markdown' and 'Shiny' Application |
---|---|
Description: | Direct insertion of over 1000 symbols (e.g. currencies, letters, emojis, arrows, mathematical symbols and so on) into 'Rmarkdown' documents and 'Shiny' applications by incorporating 'HTML' hex codes. |
Authors: | Obinna Obianom [aut, cre] |
Maintainer: | Obinna Obianom <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.4 |
Built: | 2024-11-06 02:39:57 UTC |
Source: | https://github.com/oobianom/r2symbols |
Transform string into HTML ready for Rmarkdown and Shiny
as.html(h)
as.html(h)
h |
string |
HTML form of the string for easy insertion in Shiny or Rmarkdown documents
string <- "<b>smile</b>" #html b tag included to make the string bold string_trans <- as.html(string) cat(string) #when inserted in Rmarkdown will not show up as bolded cat(string_trans) #when inserted into Rmarkdown will show up as bolded after knitting
string <- "<b>smile</b>" #html b tag included to make the string bold string_trans <- as.html(string) cat(string) #when inserted in Rmarkdown will not show up as bolded cat(string_trans) #when inserted into Rmarkdown will show up as bolded after knitting
Return TRUE or FALSE after checking if a string is empty
is.empty(string)
is.empty(string)
string |
the string to be checked |
Returns TRUE or FALSE
string <- "r2resume" string2 <- NULL is.empty(string) is.empty(string2)
string <- "r2resume" string2 <- NULL is.empty(string) is.empty(string2)
Get a symbol by name or number for use in Rmarkdown or Shiny apps
sym( ..., font.size = NULL, font.weight = NULL, font.color = NULL, if.error = FALSE, search.units.each = FALSE )
sym( ..., font.size = NULL, font.weight = NULL, font.color = NULL, if.error = FALSE, search.units.each = FALSE )
... |
the symbols to display |
font.size |
font size as integer |
font.weight |
font weight as integer |
font.color |
font color e.g. red, blue, cyan |
if.error |
error response |
search.units.each |
whether to search single letter columns |
symbol hex for HTML displays
sym("trademark") sym("alpha") sym("arrow-right") sym(144)
sym("trademark") sym("alpha") sym("arrow-right") sym(144)
Font styling for symbols
sym.setting(font.size = NULL, font.weight = NULL, font.color = NULL)
sym.setting(font.size = NULL, font.weight = NULL, font.color = NULL)
font.size |
font size as integer |
font.weight |
font weight eg. normal, bold or lighter |
font.color |
font color e.g. red, blue, cyan |
No values returned
symbol.setting(40, "bold", "green") # ascribe settings for all symbols symbol("alpha") # display the alpha symbol symbol.setting() # clear settings for symbols symbol("alpha") # display the alpha symbol
symbol.setting(40, "bold", "green") # ascribe settings for all symbols symbol("alpha") # display the alpha symbol symbol.setting() # clear settings for symbols symbol("alpha") # display the alpha symbol
Get a symbol by name or numberfor use in Rmarkdown or Shiny apps, could be a mathematical symbol or other kinds of symbols
symbol( ..., font.size = NULL, font.weight = NULL, font.color = NULL, if.error = FALSE, search.units.each = FALSE )
symbol( ..., font.size = NULL, font.weight = NULL, font.color = NULL, if.error = FALSE, search.units.each = FALSE )
... |
the symbols to display |
font.size |
font size as integer |
font.weight |
font weight as integer |
font.color |
font color e.g. red, blue, cyan |
if.error |
error response |
search.units.each |
whether to search single letter columns |
symbol hex for HTML integration
Common symbols include alpha, beta, copyright, registered, theta, sigma. See the complete list at https://github.com/oobianom/r2symbols.
symbol("trademark") symbol("alpha") symbol("arrow-right") symbol(144)
symbol("trademark") symbol("alpha") symbol("arrow-right") symbol(144)
Font styling for symbols
symbol.setting(font.size = NULL, font.weight = NULL, font.color = NULL)
symbol.setting(font.size = NULL, font.weight = NULL, font.color = NULL)
font.size |
font size as integer |
font.weight |
font weight eg. normal, bold or lighter |
font.color |
font color e.g. red, blue, cyan |
No values returned
symbol.setting(40, "bold", "green") # ascribe settings for all symbols symbol("alpha") # display the alpha symbol symbol.setting() # clear settings for symbols symbol("alpha") # display the alpha symbol
symbol.setting(40, "bold", "green") # ascribe settings for all symbols symbol("alpha") # display the alpha symbol symbol.setting() # clear settings for symbols symbol("alpha") # display the alpha symbol
Enter a unit and it will automatically be transformed to the appropriate form
symbol.units(units, error = FALSE)
symbol.units(units, error = FALSE)
units |
the desired unit e.g ug/mL,pg/mL, ab, yL |
error |
whether to report any errors |
Transformed units with substitution of symbols with appropriate symbol hex
symbol.units("ug/mL") # u will be transformed to mu symbol.units("pg/mL") # no letter will be transformed
symbol.units("ug/mL") # u will be transformed to mu symbol.units("pg/mL") # no letter will be transformed
Fetch one or more symbols by category
symCat( category, font.size = NULL, font.weight = NULL, font.color = NULL, if.error = TRUE )
symCat( category, font.size = NULL, font.weight = NULL, font.color = NULL, if.error = TRUE )
category |
symbol categories to fetch (minimum: 4 characters) |
font.size |
font size as integer |
font.weight |
font weight as integer |
font.color |
font color e.g. red, blue, cyan |
if.error |
show error response |
get symbols from matching a particular category
arrows mixed chess check mark symbol animal emoji flag people skull sign star telephone weather zodiac smiley hourglass fraction cards triangle square
symCat("arrows") symCat("smiley", font.size = 32) symCat("music") symCat("random") # should not work
symCat("arrows") symCat("smiley", font.size = 32) symCat("music") symCat("random") # should not work
Fetch one or more symbols by keyword
symKey( keyword, font.size = NULL, font.weight = NULL, font.color = NULL, if.error = TRUE )
symKey( keyword, font.size = NULL, font.weight = NULL, font.color = NULL, if.error = TRUE )
keyword |
symbol keyword to fetch |
font.size |
font size as integer |
font.weight |
font weight as integer |
font.color |
font color e.g. red, blue, cyan |
if.error |
show error response |
get group of symbols maptching a particular keyword
Common symbols include alpha, beta, copyright, registered, theta, sigma. See the complete list at https://github.com/oobianom/r2symbols.
symKey("arrow", font.size = 45) symKey("animal", font.color = "red") symKey("random454") symKey("show nothing")
symKey("arrow", font.size = 45) symKey("animal", font.color = "red") symKey("random454") symKey("show nothing")
Loads all the available symbols
symload( font.size = NULL, font.weight = NULL, font.color = NULL, if.error = TRUE )
symload( font.size = NULL, font.weight = NULL, font.color = NULL, if.error = TRUE )
font.size |
font size as integer |
font.weight |
font weight as integer |
font.color |
font color e.g. red, blue, cyan |
if.error |
error response |
No returns, but symbols are loaded
symload(40, "normal", "purple") # load symbols and add symbol settings symload() # load symbols without custom settings
symload(40, "normal", "purple") # load symbols and add symbol settings symload() # load symbols without custom settings
Transform texts in HTML to symbols
trans.r2symbols( font.size = NULL, font.weight = c("normal", "bold", "lighter"), font.color = NULL )
trans.r2symbols( font.size = NULL, font.weight = c("normal", "bold", "lighter"), font.color = NULL )
font.size |
font size as integer |
font.weight |
font weight eg. normal, bold or lighter |
font.color |
font color e.g. red, blue, cyan |
A rendered HTML where simple text is transformed to symbols using HTML codes
This function simple inserts a script within the output HTML, which transforms the content using the relevant HTML codes.
trans.r2symbols()
trans.r2symbols()