Skip to content

Commit

Permalink
Add cheatsheet to README
Browse files Browse the repository at this point in the history
  • Loading branch information
edelarua committed Mar 7, 2024
1 parent d4e071d commit 420c0b2
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 28 deletions.
8 changes: 6 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ remotes::install_github("insightsengineering/rlistings@*release")

The `rlistings` package was not a part of the October 2022 stable release of all `NEST` packages, but the list of these `NEST` packages is available [here](https://github.com/insightsengineering/depository#readme).

See [the Get started page](https://insightsengineering.github.io/rlistings/main/articles/rlistings.html) for an introduction to creating listings using this package.
See the [Get Started page](https://insightsengineering.github.io/rlistings/main/articles/rlistings.html) for an introduction to creating listings using this package.

## Cheatsheet

<a href="https://github.com/insightsengineering/rlistings/blob/main/inst/cheatsheet/rlistings_cheatsheet_03-24.pdf"><img src="https://raw.githubusercontent.com/insightsengineering/rlistings/main/inst/cheatsheet/rlistings_cheatsheet_03-24_thumbs.png" width="630" height="249"/></a>

## Usage

Expand All @@ -74,7 +78,7 @@ mtcars_ex <- mtcars %>% dplyr::mutate("car" = rownames(mtcars))
as_listing(mtcars_ex,
key_cols = c("gear", "carb"),
cols = c("gear", "carb", "qsec", "car")
disp_cols = c("qsec", "car")
) %>% head()
```

Expand Down
54 changes: 28 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# rlistings <a href='https://github.com/insightsengineering/rlistings'><img src="man/figures/logo.png" align="right" height="200" width="200"/></a>
# rlistings

<!-- start badges -->

[![Check
🛠](https://github.com/insightsengineering/rlistings/actions/workflows/check.yaml/badge.svg)](https://insightsengineering.github.io/rlistings/main/unit-test-report/)
🛠](https://github.com/insightsengineering/rlistings/actions/workflows/check.yaml/badge.svg)](https://github.com/insightsengineering/rlistings/actions/workflows/check.yaml)
[![Docs
📚](https://github.com/insightsengineering/rlistings/actions/workflows/docs.yaml/badge.svg)](https://insightsengineering.github.io/rlistings/)
[![Code Coverage
📔](https://raw.githubusercontent.com/insightsengineering/rlistings/_xml_coverage_reports/data/main/badge.svg)](https://insightsengineering.github.io/rlistings/main/coverage-report/)
📔](https://raw.githubusercontent.com/insightsengineering/rlistings/_xml_coverage_reports/data/main/badge.svg)](https://raw.githubusercontent.com/insightsengineering/rlistings/_xml_coverage_reports/data/main/coverage.xml)

![GitHub
forks](https://img.shields.io/github/forks/insightsengineering/rlistings?style=social)
Expand Down Expand Up @@ -63,54 +64,55 @@ under active development.

## Installation

`rlistings` is available on CRAN and you can install the latest released
version with:
For releases from October 2022 it is recommended that you [create and
use a Github
PAT](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)
to install the latest version of this package. Once you have the PAT,
run the following:

``` r
install.packages("rlistings")
Sys.setenv(GITHUB_PAT = "your_access_token_here")
if (!require("remotes")) install.packages("remotes")
remotes::install_github("insightsengineering/rlistings@*release")
```

or you can install the latest development version directly from GitHub
with:
The `rlistings` package was not a part of the October 2022 stable
release of all `NEST` packages, but the list of these `NEST` packages is
available
[here](https://github.com/insightsengineering/depository#readme).

``` r
remotes::install_github("insightsengineering/formatters")
remotes::install_github("insightsengineering/rlistings")
```
See the [Get Started
page](https://insightsengineering.github.io/rlistings/main/articles/rlistings.html)
for an introduction to creating listings using this package.

Note you might need to set your `GITHUB_PAT` environment variable in
order to be able to install from GitHub.
## Cheatsheet

Packaged releases (both those on CRAN and those between official CRAN
releases) can be found in the [releases
list](https://github.com/insightsengineering/rlistings/releases).
<a href="https://github.com/insightsengineering/rlistings/blob/main/inst/cheatsheet/rlistings_cheatsheet_03-24.pdf"><img src="https://raw.githubusercontent.com/insightsengineering/rlistings/main/inst/cheatsheet/rlistings_cheatsheet_03-24_thumbs.png" width="630" height="249"/></a>

## Usage

The following example shows a simple listing and its printed output.

``` r
library(rlistings)
#> Warning: package 'rlistings' was built under R version 4.2.2
#> Loading required package: formatters
#> Warning: package 'formatters' was built under R version 4.2.2
#> Loading required package: tibble

# Reducing the data
mtcars_ex <- mtcars %>% dplyr::mutate("car" = rownames(mtcars))

as_listing(mtcars_ex,
key_cols = c("gear", "carb"),
cols = c("gear", "carb", "qsec", "car")
disp_cols = c("qsec", "car")
) %>% head()
#> sorting incoming data by key columns
#> gear carb qsec car
#> gear carb qsec car
#> ———————————————————————————————————————
#> 3 1 19.44 Hornet 4 Drive
#> 20.22 Valiant
#> 20.01 Toyota Corona
#> 2 17.02 Hornet Sportabout
#> 16.87 Dodge Challenger
#> 3 1 19.44 Hornet 4 Drive
#> 20.22 Valiant
#> 20.01 Toyota Corona
#> 2 17.02 Hornet Sportabout
#> 16.87 Dodge Challenger
#> 17.3 AMC Javelin
```

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 420c0b2

Please sign in to comment.