MyNixOS website logo
Description

Lightweight Utilities for 'DIZ' R Package Development.

Lightweight utility functions used for the R package development infrastructure inside the data integration centers ('DIZ') to standardize and facilitate repetitive tasks such as setting up a database connection or issuing notification messages and to avoid redundancy.

DIZtools

CRAN StatusBadge CranChecks Dependencies R CMD Check via{tic} linting test-coverage codecov

The R package DIZtools provides utility functions used for the R package development infrastructure inside the data integration centers (‘DIZ’) to standardize and facilitate repetitive tasks such as setting up a database connection or issuing notification messages and to avoid redundancy.

:bulb: DIZtools contains all “lightweighted” functions of DIZutils making it a lot quicker to install, while DIZutils has a lot of dependencies and system requirements.

Installation

You can install DIZtools directly from CRAN:

install.packages("DIZtools")

The development version can be installed using

install.packages("remotes")
remotes::install_github("miracum/misc-diztools", ref = "dev")

Exported functions

  • assign_to_R_env(): Add variable to R environment (in contrast to system environment).
  • check_if_unique_rows(): Takes a data.table dataset and checks if for each unique element in a specified column there is exaclty one row.
  • clean_path_name(): Clean paths to surely have a tailing slash or not.
  • clear(): Clean the console and environment-variables.
  • close_all_connections(): Unset/close all open connections.
  • dt_row_to_string(): Get the content of a data.table row in print-ready format.
  • equals2(): Robust compare two elements and return true if both elements are the same. False otherwise. No NA or NULL.
  • feedback(): Function to feedback messages either to the user and/or to the console and to the logfile.
  • file_lines_to_list(): Read in lines from a file and store it in a list.
  • firstup(): Converts the first letter of the input string to uppercase.
  • format_POSIXct(): Formats a given POSIXct timestamp without the need of manually specifing format parameters.
  • get_config(): Reads a config yaml file and return the value for a given key.
  • get_current_timestamp(): Quickly get the current time stamp without the need to handle format-options etc.
  • is_date_format(): Checks if a string matches a given date format.
  • is.empty(): Check for empty/NA/NULL/NaN/etc. values.
  • notin(): notin helper function. Opposite of in function.
  • number_to_position(): Converts an integer number to its “verbal position”. 1 –> “1st”, 2 –> “2nd”, 3 –> “3rd”, 4 –> “4th”, …
  • paste_pct_sum(): Get the percentage of two values pretty formatted.
  • paste2(): Normal paste function with additional collapse_last argument.
  • pretty_timestamp(): Quickly get a pretty timestamp without need to handle format-options etc.
  • rep2(): Repeat something with the ability to also collapse the output.
  • robust_round(): Round numbers without problems.
  • setdiff_all(): Get the difference of two vectors in both directions.
  • setenv_file(): Set all variables of a .env file to the system environment.
  • setenv2(): Assign variables to the system environment.
  • string_replacements(): Clean string with a given set of replacements.
  • time_diff_print(): Calculate time difference of two timestamps, round the value and return a string with suiting unit.
  • trim.space(): Trim Spaces of a string.
  • vgsub(): Vectorised string replacement.

Internal functions

:bulb: Use with care. Can be used by typing DIZtools:::internal_function_name() (<- using three :). Not recommended.

More Infos

Metadata

Version

1.0.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows