Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/tjmahr/htmlent

Package to make HTML entities available to RStudio's autocompletion
https://github.com/tjmahr/htmlent

Last synced: about 1 month ago
JSON representation

Package to make HTML entities available to RStudio's autocompletion

Awesome Lists containing this project

README

        

---
output: github_document
---

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

A simple data package with HTML entities, downloaded from
[this page](https://dev.w3.org/html5/html-author/charref).

## Installation

You can install htmlent from GitHub with:

```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("tjmahr/htmlent")
```

## Example

I am writing some RMarkdown, and I want to express a statistic as the mean
plus-minus the standard deviation. I can never remember the entity for the
plus-minus character, so I have to look it up online.

Not anymore. I can just get the entity by using RStudio's autocompletion on the
`htmlent` object. I type `htmlent::ents$` then hit `tab` to bring up the
autocompletion and type `plus-m` and find it.

```{r example}
htmlent::ents$`plus-minus sign`
```

### Might as well make a dataframe of them all

```{r}
df <- tibble::data_frame(
symbol = unlist(htmlent::ents),
entity = paste0("`", symbol, "`"),
name = names(htmlent::ents)
)

knitr::kable(df)
```