hutils2.0.0 package

Miscellaneous R Functions and Aliases

ahull

Maximum area given x and y coordinates

aliases

Aliases

all_same_sign

Determine whether a vector is all of the same sign

any_grepl

Does the pattern appear anywhere?

auc

AUC

average_bearing

Average of bearings

bearing

Bearing calculations

coalesce

Find first non-missing element

dev_copy2a4

Copy device to an A4 PDF

dir2

List many files

drop_col

Drop column or columns

drop_colr

Drop columns whose names match a pattern

drop_constant_cols

Drop constant columns

drop_empty_cols

Drop empty columns

duplicated_rows

Return duplicated rows of data.table

ein

Exists and (not) in

find_pattern_in

Find string pattern in (text) file

fst_columns

Utilities for fst files

generate_LaTeX_manual

Generate LaTeX manual of installed package

grapes-notchin-grapes

Negation of in (character)

grapes-notin-grapes

Negation of in

grapes-pin-grapes

Partial in

haversine_distance

Distance between two points on the Earth

hutils-package

hutils package

if_else

Vectorized if

implies

#' Logical implies

isAttached

Is a package attached?

isTrueFalse

Logical assertions

longest_affix

Longest common prefix/suffix

mean_na

Proportion of values that are NA.

Mode

Statistical mode

mutate_ntile

Add a column of ntiles to a data table

mutate_other

Group infrequent entries into 'Other category'

ngrep

Anti-grep

prohibit_unequal_length_vectors

Prohibit unequal length vectors

prohibit_vector_recycling

Prohibit vector recycling

provide.dir

Provide directory

provide.file

Provide a file

replace_pattern_in

Replace string pattern in text file

report_error

Report errors and warnings

RQ

Shorthand for requireNamespace

samp

Safer sampler

select_grep

Select names matching a pattern

select_which

Select columns satisfying a condition

selector

Fast selection of data.table columns

seq_nrow

Generate sequence of row numbers

set_cols_first

Put columns first or last

swap

Swap assignment

Switch

Vectorized switch

unique-keys

Unique keys

weight2rows

Expand a weighted data frame to an equivalent unweighted

weighted_ntile

Weighted (ranked) quantiles

weighted_quantile

Weighted quantile

Provides utility functions for, and drawing on, the 'data.table' package. The package also collates useful miscellaneous functions extending base R not available elsewhere. The name is a portmanteau of 'utils' and the author.

  • Maintainer: Hugh Parsonage
  • License: GPL-3
  • Last published: 2026-01-18