• Stars
    star
    309
  • Rank 135,306 (Top 3 %)
  • Language
    R
  • Created about 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

R package to easily insert web icons to RMarkdown

icons

R build status Coverage status lifecycle CRAN_Status_Badge

The icons package for R makes adding web icons to reports, presentations and apps easy. It integrates many popular icon libraries from around the web with a simple interface that works with any rmarkdown output format. If a particular icon library is not explicitly supported by this package, you can still use it by creating a custom icon set from a folder of SVG files. Icons provide flexible means of digital expression, allowing expressions and functionality beyond what is possible with emoji.

The icons package currently provides helpful tools for downloading and using icons from these libraries:

Installation

The development version can be installed from GitHub using:

# install.packages("remotes")
remotes::install_github("mitchelloharawild/icons")

Once you’ve installed the package you’ll also need to download some icons! Supported icon libraries (listed above) can be downloaded using the download_*() functions. For example, to download the Font Awesome icons you would use download_fontawesome().

Usage

library(icons)
#> ── Installed icons ─────────────────────────────────────────────── icon 0.2.0 ──
#> βœ“ ionicons        5.2.3       βœ“ feather_icons   v4.28.0
#> βœ“ academicons     1.9.1       βœ“ octicons        11.2.0 
#> βœ“ simple_icons    4.4.0       βœ“ fontawesome     5.15.2 
#> βœ“ google_material 4.0.0

Icons can be inserted inline using inline code `r icons::fontawesome("rocket", style = "solid")` or `r icons::fontawesome$solid$rocket` .

Icons can also be inserted using usual R chunks.

```{r icon-chunk}
fontawesome("rocket", style = "solid") # equivalent to icons::fontawesome$solid$rocket
```

If the icon name contains non-syntactic name characters like a - or +, you will need to quote the name with backticks, single or double quotes:

fontawesome$brands$`r-project` # or 'r-project' or "r-project"

The appearance of an icon can be customised using the icon_style() function.

```{r icon-style}
icon_style(fontawesome("rocket", style = "solid"), scale = 2, fill = "red")
```

Custom icon sets can be created using the icon_set() function, which accepts a directory of SVG files and allows them to be used as icons.

```{r icon-custom}
custom <- icons::icon_set("hex")
custom$icons
```

You can also search for icons using the icon_find() function.

icon_find("rocket")
#> $`ionicons$rocket`
#> <svg viewBox="0 0 512 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg">
#>   <title></title>
#>   <path d="M328.85,156.79a26.69,26.69,0,1,0,18.88,7.81A26.6,26.6,0,0,0,328.85,156.79Z"></path>
#>   <path d="M477.44,50.06a.29.29,0,0,1,0-.09,20.4,20.4,0,0,0-15.13-15.3c-29.8-7.27-76.68.48-128.63,21.28-52.36,21-101.42,52-134.58,85.22A320.7,320.7,0,0,0,169.55,175c-22.33-1-42,2.18-58.57,9.41-57.74,25.41-74.23,90.44-78.62,117.14a25,25,0,0,0,27.19,29h.13L124,323.53c.08.82.17,1.57.24,2.26a34.36,34.36,0,0,0,9.9,20.72l31.39,31.41a34.27,34.27,0,0,0,20.71,9.91l2.15.23-7,64.24s0,.08,0,.13A25,25,0,0,0,206,480a25.25,25.25,0,0,0,4.15-.34C237,475.34,302,459.05,327.34,401c7.17-16.46,10.34-36.05,9.45-58.34a314.78,314.78,0,0,0,33.95-29.55c33.43-33.26,64.53-81.92,85.31-133.52C476.74,128.23,484.53,81,477.44,50.06ZM370.38,224.94a58.77,58.77,0,1,1,0-83.07A58.3,58.3,0,0,1,370.38,224.94Z"></path>
#>   <path d="M161.93,386.44a16,16,0,0,0-11,2.67c-6.39,4.37-12.81,8.69-19.29,12.9-13.11,8.52-28.79-6.44-21-20l12.15-21a16,16,0,0,0-15.16-24.91A61.25,61.25,0,0,0,72,353.56c-3.66,3.67-14.79,14.81-20.78,57.26A357.94,357.94,0,0,0,48,447.59,16,16,0,0,0,64,464h.4a359.87,359.87,0,0,0,36.8-3.2c42.47-6,53.61-17.14,57.27-20.8a60.49,60.49,0,0,0,17.39-35.74A16,16,0,0,0,161.93,386.44Z"></path>
#> </svg>
#> 
#> $`octicons$rocket`
#> <svg viewBox="0 0 16 16" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg">
#>   <path fill-rule="evenodd" d="M14.064 0a8.75 8.75 0 00-6.187 2.563l-.459.458c-.314.314-.616.641-.904.979H3.31a1.75 1.75 0 00-1.49.833L.11 7.607a.75.75 0 00.418 1.11l3.102.954c.037.051.079.1.124.145l2.429 2.428c.046.046.094.088.145.125l.954 3.102a.75.75 0 001.11.418l2.774-1.707a1.75 1.75 0 00.833-1.49V9.485c.338-.288.665-.59.979-.904l.458-.459A8.75 8.75 0 0016 1.936V1.75A1.75 1.75 0 0014.25 0h-.186zM10.5 10.625c-.088.06-.177.118-.266.175l-2.35 1.521.548 1.783 1.949-1.2a.25.25 0 00.119-.213v-2.066zM3.678 8.116L5.2 5.766c.058-.09.117-.178.176-.266H3.309a.25.25 0 00-.213.119l-1.2 1.95 1.782.547zm5.26-4.493A7.25 7.25 0 0114.063 1.5h.186a.25.25 0 01.25.25v.186a7.25 7.25 0 01-2.123 5.127l-.459.458a15.21 15.21 0 01-2.499 2.02l-2.317 1.5-2.143-2.143 1.5-2.317a15.25 15.25 0 012.02-2.5l.458-.458h.002zM12 5a1 1 0 11-2 0 1 1 0 012 0zm-8.44 9.56a1.5 1.5 0 10-2.12-2.12c-.734.73-1.047 2.332-1.15 3.003a.23.23 0 00.265.265c.671-.103 2.273-.416 3.005-1.148z"></path>
#> </svg>
#> 
#> $`fontawesome$solid$rocket`
#> <svg viewBox="0 0 512 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg">
#>   <path d="M505.12019,19.09375c-1.18945-5.53125-6.65819-11-12.207-12.1875C460.716,0,435.507,0,410.40747,0,307.17523,0,245.26909,55.20312,199.05238,128H94.83772c-16.34763.01562-35.55658,11.875-42.88664,26.48438L2.51562,253.29688A28.4,28.4,0,0,0,0,264a24.00867,24.00867,0,0,0,24.00582,24H127.81618l-22.47457,22.46875c-11.36521,11.36133-12.99607,32.25781,0,45.25L156.24582,406.625c11.15623,11.1875,32.15619,13.15625,45.27726,0l22.47457-22.46875V488a24.00867,24.00867,0,0,0,24.00581,24,28.55934,28.55934,0,0,0,10.707-2.51562l98.72834-49.39063c14.62888-7.29687,26.50776-26.5,26.50776-42.85937V312.79688c72.59753-46.3125,128.03493-108.40626,128.03493-211.09376C512.07526,76.5,512.07526,51.29688,505.12019,19.09375ZM384.04033,168A40,40,0,1,1,424.05,128,40.02322,40.02322,0,0,1,384.04033,168Z"></path>
#> </svg>

A Note on the old API

This is the second iteration of the icon package, the first icon package has been successful, but lacked a few features such as SVG icons, user defined libraries, and extensibility support. You can read the notes on the new API here. It turns out that it was easier to build the new and improved icon from scratch, which is what this repository is. In the future this version of icon might just be merged into rOpenScilabs/icon, but for the mean time it will be developed here. We anticipate that there will only be any minor changes to the existing API, so hopefully this will be a seamless transition for users! Notably, the icon_name functions have been removed in favour of icon$name, and the interface for styling and animating has been removed/changed.

More Repositories

1

vitae

R Markdown RΓ©sumΓ©s and CVs
R
1,213
star
2

distributional

Vectorised distributions for R
R
94
star
3

hexwall

R script to neatly align hexagon stickers
R
68
star
4

fable.prophet

fable extension for the prophet forecasting procedure
R
55
star
5

ggquiver

R package for quiver plots in 'ggplot2'
R
51
star
6

CV

Curriculum Vitae
TeX
38
star
7

talk-forecast-to-fable

HTML
8
star
8

talk-user2018-fasster

Presentation about FASSTER at useR! 2018
JavaScript
7
star
9

workshop-fable-user2024

Materials for a 3 hour workshop on tidy forecasting for useR! 2024
HTML
6
star
10

tidyverse-dev-day

Shiny app for tracking tidyverse developer day issues
R
5
star
11

fable.timegpt

fable sdk for the timegpt forecasting api
R
4
star
12

slides

Repository used to host all slides at slides.mitchelloharawild.com
JavaScript
4
star
13

mixtime

Mixed time vectors for R
R
4
star
14

ggicon

Icon Geometries for 'ggplot2'
R
4
star
15

talk-tfeam2018

Slides and resources for the fable talk at TFEAM
JavaScript
4
star
16

workshop-r-medicine-2024

Materials for a 3 hour workshop on tidy time series analysis and forecasting for R/Medicine 2024
SCSS
4
star
17

workshop-nyr2023

Slides, exercises and materials for the NYR 2023 tidy time series and forecasting workshop
TeX
3
star
18

talk-distributional

HTML
3
star
19

slides_old

Slides for presentations
HTML
3
star
20

rstudioconf20-helper

Small shiny app to help with selecting sessions from the rstudio::conf(2020) agenda
R
3
star
21

ShinyGrader

A shiny app to assist with the grading of R Markdown assignments
R
3
star
22

quarto-learnr

A quarto and webr conversion of the numbats/learnr project (WIP)
HTML
3
star
23

talk-research-practices-quarto

A Monash University workshop presentation for good research practices with Quarto
HTML
2
star
24

graphvec

Vectorised graph data structures for R
R
2
star
25

fable.tscount

Fable Modelling Wrappers for 'tscount'
R
2
star
26

obsbot-tiny-2-control

Send commands via Python to control AI modes of the OBSBOT Tiny 2
Python
2
star
27

feasts.tsfresh

R interface to the tsfresh python library
R
2
star
28

workshop-shiny-intermediate

Workshop materials for communicating data with R packages
HTML
2
star
29

talk-fable-combinations

Slides and resources for the fable talk at useR!2019 and ISF 2019
JavaScript
2
star
30

talk-reconciling-graphs

TeX
2
star
31

blog

Written in blogdown, powered by hugo, hosted by netlify
CSS
2
star
32

talk-prato2023

JavaScript
1
star
33

talk-moodlequiz

Slides and resources for the moodlequiz talk OZCOTS 2023
SCSS
1
star
34

talk-pruning-graphs

HTML
1
star
35

OnePackagePerMeetup-gganimate

HTML
1
star
36

monash-intro-r

Experimental intro R course for Monash students
CSS
1
star
37

hive

Team hive's entry to the useR!2018 datathon
R
1
star
38

workshop-shiny-ssa23

Materials for a 3 hour workshop on the basics of shiny developed for the SSA SCV 2023 workshop
JavaScript
1
star
39

talk-statistical-software-design

CSS
1
star
40

workshop-shiny-basics

Materials for a 3 hour workshop on the basics of shiny developed for the WOMBAT 2022 workshop
HTML
1
star
41

workshop-f4sg-um6p

Materials for a 2 day forecasting for social good workshop in Morocco
HTML
1
star
42

logical

Truth tables and other functions symbolic logic
R
1
star
43

talk-researchtools-rmd

Monash University Research Tools - More R Markdown
JavaScript
1
star
44

phd-confirmation

Materials for my PhD confirmation's panel presentation and report
HTML
1
star