Package 'aleksandeR'

Title: Aleksander Bang-Larsen's personal convenience functions
Description: This package supplies all the convenience functions that I have written to make my life easier.
Authors: Aleksander Bang-Larsen [aut, cre, cph]
Maintainer: Aleksander Bang-Larsen <[email protected]>
License: AGPL (>= 3)
Version: 0.0.0.9000
Built: 2024-11-18 07:28:20 UTC
Source: https://github.com/aleksanderbl29/aleksandeR

Help Index


Format a number for presentation

Description

Format a number for presentation

Usage

format_num(
  x,
  decimals = 2,
  rounding = TRUE,
  big_mark = ".",
  decimal_mark = ","
)

Arguments

x

An integer/double value.

decimals

The amount of decimals the input x should be rounded to.

rounding

Whether or not the input x should be rounded. Excludes the use of the decimals argument.

big_mark

The thousand separator.

decimal_mark

The decimal separator.

Value

A number formatted correctly with two (default) decimals, a comma as the decimal separator and a period as the thousand-separator. The type is characther.

Examples

x <- pi
format_num(x)

format_num(x, 1)

format_num(x, rounding = FALSE)

Create bibliography of {renv}-installed packages

Description

This was inspired by https://github.com/rstudio/renv/issues/340

Usage

pkg_bib(dependencies = FALSE, filename = "packages.bib")

Arguments

dependencies

Boolean to define how many packages are cited.

filename

Specify a filename/path for the .bib.

Value

Usually called for its side effect of a .bib written to the provided paths. Also outputs the package names in the console.


A theme made for maps from ggplot2::geom_map().

Description

This theme is made specifically for maps made with. A color-ready version exists as theme_map_color().

Usage

theme_map(base_size = 9, base_family = "")

Arguments

base_size

base font size, given in pts.

base_family

base font family


A color-ready theme made for maps from ggplot2::geom_map().

Description

This theme is made color-ready specifically for maps.

Usage

theme_map_color(
  color = "green",
  secondary_color = "pink",
  background_color = "black",
  base_size = 9,
  base_family = ""
)

Arguments

color

The primary color of the theme_map_color() plot. "Default is "green".

secondary_color

The secondary color of the theme_map_color() plot. Default is "pink".

background_color

The primary color of the theme_map_color() plot. Defaults is "black".

base_size

base font size, given in pts.

base_family

base font family