Package 'jemisc'

Title: Personal Collection of Stuff and Things
Description: Just another personal R package. This package provides no greater value to the R community, it is merely a place for me to dump stuff that I ended up writing and found mildly useful.
Authors: Lukas Burk [aut, cre]
Maintainer: Lukas Burk <[email protected]>
License: MIT + file LICENSE
Version: 0.0.4
Built: 2025-02-11 04:42:58 UTC
Source: https://github.com/jemus42/jemisc

Help Index


Cite Used Packages

Description

Cite Used Packages

Usage

cite_loaded_pkgs()

Value

A tbl

Examples

cite_loaded_pkgs()

Get a color palette from a coolors.co URL

Description

Get a color palette from a coolors.co URL

Usage

coolors_pal(url)

Arguments

url

The link to a coolors.co palette, e.g. "https://coolors.co/29adb2-182326-2a3a3f-69818c-8ea4b2"

Value

character(5) with RGB color codes, e.g. c("#29adb2", "#182326", "#2a3a3f", "#69818c", "#8ea4b2") for the example url.

Note

It's only the URL that's parsed, there's no need for an internet connection. The url does not need to be valid, since only hex strings of length 6 (i.e. color codes like F75AB1) are looked for, and a ⁠#⁠ is prepended.

Examples

coolors_pal("https://coolors.co/29adb2-182326-2a3a3f-69818c-8ea4b2")

Create a .bib for Your Installed Packages

Description

Create a .bib for Your Installed Packages

Usage

make_pkg_bib(output = "~/Documents/BibTex/rstats.bib", fresh = TRUE)

Arguments

output

Location of the output .bib.

fresh

Whether to overwrite output.

Value

Nothing

Examples

## Not run: 
make_pkg_bib(output = "~/packages.bib")

## End(Not run)

Print a matrix for LaTeX.

Description

Print a matrix for LaTeX.

Usage

mattex(mat, type = "pmatrix", round = 3)

Arguments

mat

A matrix.

type

⁠[character(1): "pmatrix"]⁠: Matrix environment to use, e.g. bmatrix for ⁠[]⁠-enclosed (brackets) or pmatrix for ⁠()⁠ (parentheses).

round

⁠[integer(1): 3]⁠

Value

Nothing, output is cated.

Examples

mat <- matrix(1:9, ncol = 3)
mattex(mat)

Export installed packages for somehwat functional reinstallation

Description

Export installed packages for somehwat functional reinstallation

Usage

pkg_export(old_lib = "~/Library/R/shared_bak/")

Arguments

old_lib

character: The location of your previous package library.

Examples

## Not run: 
pkg_export()

## End(Not run)

Print diceroll

Description

Print diceroll

Usage

## S3 method for class 'sr_d6'
print(x, ...)

Arguments

x

Object of class sr_d6, like from sr_d6.

...

Ignored

Value

Nothing

Examples

sr_d6(5)

Render a bunch of small .tex files

Description

Use case: A bunch of stuff done in LaTeXiT, resulting in some helper calculations or derivations contained in tex files. These are then rendered to PDF using tex_fun, per default tinytex::xelatex, and then optionally converted to png using the system convert tool via imagemagick.

Usage

render_tex_files(
  path,
  cleanup = TRUE,
  tex_fun = tinytex::xelatex,
  to_png = TRUE
)

Arguments

path

Folder where .tex files are.

cleanup

TRUE: Whether to cleanup auxilliary files (e.g. .aux, .log, ...)

tex_fun

Which function to use, default ist tinytex::xelatex.

to_png

TRUE: Whether to use convert to convert PDF to png.

Value

Nothing

Examples

## Not run: 
render_tex_files("formulas")

## End(Not run)

Get Current RStudio Daily Version

Description

Get Current RStudio Daily Version

Usage

rs_daily()

Value

A character of length 1

Examples

rs_daily()

Get Current RStudio Preview Version

Description

Get Current RStudio Preview Version

Usage

rs_preview()

Value

A character of length 1

Examples

rs_preview()

Get Current RStudio Version

Description

Get Current RStudio Version

Usage

rs_release()

Value

A character of length 1

Examples

rs_release()

Get Currently Installed RStudio Version

Description

Get Currently Installed RStudio Version

Usage

rs_version()

Value

A character of length 1

Examples

## Not run: 
rs_version()

## End(Not run)

Roll some d6 for Shadowrun

Description

Roll some d6 for Shadowrun

Usage

sr_d6(n)

Arguments

n

Number of d6 to roll

Value

A list of additional class "sr_d6".

Examples

sr_d6(10)

Tabularize tidily

Description

Use janitor::tabyl and various adorn_-functions to create a tidy crosstab.

Usage

tidyxtab(data, x, y, row_name = deparse(x), col_name = deparse(y))

Arguments

data

A data.frame.

x

The row-variable

y

The column-variable

row_name, col_name

Passed to janitor::adorn_title.

Value

A janitor::tabyl

Examples

tidyxtab(mtcars, carb, gear)