Learn R Programming

fuj

The goal of {fuj} is to provide low level tools for other packages by Jordan.

Installation

Install {fuj} from CRAN with:

install.packages("fuj")

Alternatively, you can install the development version of {fuj} GitHub with:

# install.packages("devtools")
devtools::install_github("jmbarbone/fuj")

Example

library(fuj)

Quicker data.frames:

quick_df(list(a = 1:5, b = letters[1:5]))
#>   a b
#> 1 1 a
#> 2 2 b
#> 3 3 c
#> 4 4 d
#> 5 5 e
quick_dfl(a = 1:3, b = list(1:5, 6:10, 11:15))
#>   a                  b
#> 1 1      1, 2, 3, 4, 5
#> 2 2     6, 7, 8, 9, 10
#> 3 3 11, 12, 13, 14, 15

More extensions:

1:10 %out% c(1, 3, 5, 9)       # opposite of %in% 
#>  [1] FALSE  TRUE FALSE  TRUE FALSE  TRUE  TRUE  TRUE FALSE  TRUE
letters[1:5] %wo% letters[3:7]
#> [1] "a" "b"
letters[1:5] %wi% letters[3:7]
#> [1] "c" "d" "e"

Simple structures:

struct(list(a = 1, b = 2), class = "foo", c = 3, d = 3)
#> [[1]]
#> [1] 1
#> 
#> [[2]]
#> [1] 2
#> 
#> attr(,"c")
#> [1] 3
#> attr(,"d")
#> [1] 3
#> attr(,"class")
#> [1] "foo"

Suppress messages and warnings:

foo <- function(...) { message(paste0(list(...))) ; c(...) }
muffle(foo(1:3))
#> [1] 1 2 3
sapply(1:3, muffle(fun = foo))
#> [1] 1 2 3

x <- list("a", 1)
wuffle(as.integer(x))
#> [1] NA  1
sapply(x, wuffle(fun = as.integer))
#> [1] NA  1

Copy Link

Version

Install

install.packages('fuj')

Monthly Downloads

308

Version

0.2.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Last Published

May 20th, 2024

Functions in fuj (0.2.1)

new_condition

New condition
op.fuj

{fuj} options
verbose

Verbose
quick_df

Quick DF
names

Set names
alias_arithmetic

Arithmetic wrappers
fuj-package

fuj: Functions and Utilities for Jordan
if_null

Default value for NULL or no length
fp

File path
include

Include exports in Search Path
colons

Colons
exattr

Exact attributes
collapse

Collapse
alias_extract

Extract and replace aliases
os

Determine operating systems
require_namespace

Require namespace
list0

Listing for dots
struct

Simple structures
muffle

Muffle messages
match_ext

Value matching - Extensions
flip

Flip