Package 'icons'

Title: SVG Icons for R Documents and Apps
Description: Easily embed SVG icons into R Markdown documents or shiny apps. A collection of popular icon sets are supported by the package, including Font Awesome, Academicons and Ionicons.
Authors: Mitchell O'Hara-Wild [aut, cre], Earo Wang [ctb], Timothy Hyndman [ctb], Matthew T. Warkentin [ctb], Tom Jemmett [ctb]
Maintainer: Mitchell O'Hara-Wild <[email protected]>
License: GPL-3
Version: 0.2.0
Built: 2024-11-02 03:26:25 UTC
Source: https://github.com/mitchelloharawild/icons

Help Index


Academicons icons

Description

Academicons is a specialist icon font for academics. It contains icons for websites and organisations related to academia that are often missing from mainstream font packages. It can be used by itself, but its primary purpose is to be used as a supplementary package alongside a larger icon set.

Usage

download_academicons(version = "dev")

academicons(name)

Arguments

version

Version of the library

name

Name of the icon


Bioicons icons

Description

Bioicons is a free library of open source icons for scientific illustrations using vector graphics software such as Inkscape or Adobe Illustrator.

Usage

download_bioicons()

bioicons(name, category = NULL)

Arguments

name

Name of the icon.

category

The icon's category, one of "Animals", "Blood_immunology", "Cell_lines", "Cell_membrane", "Chemistry", "Chemo-_and_Bioinformatics", "General_items", "Genetics", "Human_physiology", "Intracellular_components" , "Lab_apparatus", "Machine_Learning", "Microbiology", "Nucleic_Acids", "Oncology", "Parasites", "Receptor_channels", "Safety_symbols", "Scientific_graphs", "Tissues", or "Viruses". If NULL, it will default to the first available icon with this name.

See Also

https://bioicons.com/


Feather Icons

Description

Feather Icons

Usage

download_feather_icons(version = "dev")

feather_icons(name)

Arguments

version

Version of the library

name

Name of the icon


Font Awesome icons

Description

Font Awesome icons

Usage

download_fontawesome(version = "dev")

fontawesome(name, style = NULL)

Arguments

version

Version of the library

name

Name of the icon

style

Style of the icon. If NULL, a default style will be chosen for the specified icon.


Google's Material design icons

Description

Google's Material design icons

Usage

download_google_material(version = "dev")

google_material(name, category = NULL, theme = NULL)

Arguments

version

Version of the library

name

Name of the icon

category

The icon's category, either "action", "alert", "av", "communication", "content", "device", "editor", "file", "hardware", "home", "image", "maps", "navigation", "notification", "places", "social", or "toggle"

theme

The style variant for the icon, requires v4.0.0 or greater. Available themes vary by icon, but can be either "filled", "outlined", "round", "sharp", or "twotone". If NULL, it will default to the first available variant in this order.

See Also

https://material.io/resources/icons/


Health icons

Description

Health icons

Usage

download_health_icons()

health_icons(name, category = NULL, theme = NULL)

Arguments

name

Name of the icon

category

The icon's category, either "blood", "body", "conditions", "devices", "diagnostics", "emotions", "family", "medications", "objects", "people", "places", "shapes", "specialties", "symbols", "typography", or "vehicles"

theme

The style variant for the icon, requires v4.0.0 or greater. Available themes vary by icon, but can be either "filled", "negative", "outline". If NULL, it will default to the first available variant in this order.


Ionicons icons

Description

Ionicons icons

Usage

download_ionicons(version = "dev")

ionicons(name)

Arguments

version

Version of the library

name

Name of the icon


GitHub's Octicons

Description

GitHub's Octicons

Usage

download_octicons(version = "dev")

octicons(name)

Arguments

version

Version of the library

name

Name of the icon

See Also

https://primer.style/octicons/


Simple Icons

Description

Simple Icons

Usage

download_simple_icons(version = "dev")

simple_icons(name)

Arguments

version

Version of the library

name

Name of the icon


Migration tools

Description

The icon package has been overhauled to be more efficient and extensible. Unfortunately this has led to several necessary interface changes. To minimise impact, please use the migrate_icon() function to update your files to use the new interface.

Usage

fa(...)

ii(...)

ai(...)

Arguments

...

Unused.


Find icons in installed sets by name

Description

Find icons in installed sets by name

Usage

icon_find(name, set = NULL)

Arguments

name

The name of the icon

set

Icon sets to search. If NULL, all available icons will be searched.


Check if an icon set is installed.

Description

This function will return TRUE if the icons for an icon set are installed. If they aren't, they can be installed using the appropriate ⁠download_*()⁠ function.

Usage

icon_installed(x)

Arguments

x

An icon set (such as fontawesome).


Save icons into a local path

Description

Store icons in a local directory to simplify sharing of documents containing icons. Bundling icons with your document or app avoids the need for collaborators or servers to have all icons from a library installed.

Usage

icon_save(icons, path = ".")

Arguments

icons

A named list of icons, the names specify the icon's name in the new icon set.

path

A directory to save the icons into.

Examples

if(icon_installed(fontawesome) && icon_installed(ionicons)){

icon_save(
  list(arrow = fontawesome$solid$`arrow-right`, alarm = ionicons$alarm),
  path = "icons"
)

app_icons <- icon_set("icons")
app_icons$arrow

}

Create a custom icon set

Description

Create a custom icon set

Usage

icon_set(path, meta = list(name = "Custom", version = NULL, license = NULL))

Arguments

path

Path to the icons

meta

Meta information for the icons


Customise the style of an icon

Description

Customise the style of an icon

Usage

icon_style(x, scale = NULL, fill = NULL, rotate = NULL, ...)

Arguments

x

The icon to style.

scale

Scaled size of the icon.

fill

The colour for the fill.

rotate

The angle to rotate the icon.

...

Other CSS rules for the icon style, for example float = "right".


Read an individual icon

Description

Read an individual icon

Usage

read_icon(x)

Arguments

x

Path to the icon