Package: hutilscpp 0.10.4

Hugh Parsonage

hutilscpp: Miscellaneous Functions in C++

Provides utility functions that are simply, frequently used, but may require higher performance that what can be obtained from base R. Incidentally provides support for 'reverse geocoding', such as matching a point with its nearest neighbour in another array. Used as a complement to package 'hutils' by sacrificing compilation or installation time for higher running speeds. The name is a portmanteau of the author and 'Rcpp'.

Authors:Hugh Parsonage [aut, cre], Simon Urbanek [ctb]

hutilscpp.pdf |hutilscpp.html
hutilscpp/json (API)

# Install hutilscpp in R:
install.packages('hutilscpp', repos = c('', ''))

Peer review:

Bug tracker:

Uses libs:
  • openmp– GCC OpenMP (GOMP) support library


61 exports 10 stars 2.38 score 4 dependencies 4 dependents 2.0k downloads

Last updated 6 months agofrom:1393f35274b7ef96d4a49c1d48ff73ce331a9714



Readme and manuals

Help Manual

Help pageTopics
Absolute differenceabs_diff max_abs_diff
Is a vector empty?allNA
Are any values outside the interval specified?anyOutside
Are elements of a vector even?are_even which_are_even
Coerce from double to integer if safeas_integer_if_safe
Evaluate time of computationbench_system_time
Character to numericcharacter2integer
Convenience function for coalescing to zeroCOALESCE0 coalesce0
Faster version of 'scales::comma'Comma
Count logicalscount_logical
Cumulative sum unless resetcumsum_reset
What is the diameter of set of points?diam thinner
Divisibilitydivisible divisible16 divisible2
Every integerevery_int
Parallel fastmatchingfinp fmatchp fnotinp
Is a vector constant?isntConstant is_constant
Is a vector sorted?isntSorted is_sorted
Vectorized logical with support for short-circuitsand3 logical3 or3
Complex logical expressionsand3s logical3s or3s
Match coordinates to nearest coordinatesmatch_nrst_haversine
Minimum and maximumminmax
Most common elementModeC
Parallel maximum/minimumpmax0 pmax3 pmaxC pmaxV pmin0 pmin3 pminC pminV
Find a binary pole of inaccessibilitypoleInaccessibility poleInaccessibility2 poleInaccessibility3
Range C++range_rcpp
Squish into a rangesquish
Sum of logical expressionssum_and3s sum_or3s
Number of missing valuessum_isna
Distinct elementsuniqueN_fmatch unique_fmatch
Where does a logical expression first return 'TRUE'?which_first which_last
First/last position of missing valueswhich_firstNA which_lastNA
At which point are all values true onwardswhich_true_onwards
which of three vectors are the elements (all, any) true?which3
Separated whichwhichs
Exclusive orxor2