-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
79 lines (57 loc) · 1.82 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# fuj <a href='https://github.com/jmbarbone/fuj'><img src='man/figures/logo.png' align="right" height="139" /></a>
<!-- badges: start -->
[![R-CMD-check](https://github.com/jmbarbone/fuj/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jmbarbone/fuj/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/jmbarbone/fuj/branch/main/graph/badge.svg)](https://app.codecov.io/gh/jmbarbone/fuj?branch=main)
[![CRAN status](https://www.r-pkg.org/badges/version/fuj)](https://CRAN.R-project.org/package=fuj)
<!-- badges: end -->
The goal of `{fuj}` is to provide low level tools for other packages by [Jordan](https://github.com/jmbarbone).
## Installation
Install `{fuj}` from CRAN with:
``` r
install.packages("fuj")
```
Alternatively, you can install the development version of `{fuj}` [GitHub](https://github.com/) with:
```
# install.packages("devtools")
devtools::install_github("jmbarbone/fuj")
```
## Example
```{r examples}
library(fuj)
```
Quicker `data.frame`s:
```{r quick_df}
quick_df(list(a = 1:5, b = letters[1:5]))
quick_dfl(a = 1:3, b = list(1:5, 6:10, 11:15))
```
More extensions:
```{r matching}
1:10 %out% c(1, 3, 5, 9) # opposite of %in%
letters[1:5] %wo% letters[3:7]
letters[1:5] %wi% letters[3:7]
```
Simple structures:
```{r struct}
struct(list(a = 1, b = 2), class = "foo", c = 3, d = 3)
```
Suppress messages and warnings:
```{r}
foo <- function(...) { message(paste0(list(...))) ; c(...) }
muffle(foo(1:3))
sapply(1:3, muffle(fun = foo))
x <- list("a", 1)
wuffle(as.integer(x))
sapply(x, wuffle(fun = as.integer))
```