Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/r4fun/icongram

:v: Icongram for R
https://github.com/r4fun/icongram

icongram icons rstats shiny

Last synced: 3 months ago
JSON representation

:v: Icongram for R

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)

library(icongram)
```

# icongram

[![R build status](https://github.com/r4fun/icongram/workflows/R-CMD-check/badge.svg)](https://github.com/r4fun/icongram/actions)

`r scales::comma(nrow(igrams))` icons for shiny development thanks to [icongram](https://icongr.am).

```{r, echo=FALSE}
knitr::include_graphics("man/figures/demo.png")
```

## Installation

You can install the development version of icongram from GitHub with:

``` r
# install.packages("devtools")
devtools::install_github("r4fun/icongram")
```

## Example

Return an icon by calling `igram`:

```r
igram(
icon = "r",
lib = "simple",
size = 128,
color = "default" # alternatively, a hexcode
)
```

Icon information is stored in `igrams`:

```{r}
igrams
```

A small shiny example:

```r
library(shiny)
library(icongram)

ui <- fluidPage(
fluidRow(
column(
width = 12,
align = "center",
h1("icongram for shiny"),
igram("r"),
br(),
tags$code('icongram::igram("r")')
)
)
)

server <- function(input, output, session) {

}

shinyApp(ui, server)
```

To view the raw HTML, use `raw = TRUE`:

```r
igram("r", raw = TRUE)
```

```{r, echo=FALSE}
print(igram("r", raw = TRUE))
```