fuj 0.3.0
CRAN release: 2026-10-08
Deprecations
-
quick_dfl()is now deprecated #91
Improvements and bug fixes
-
match_extfunctions have minor improvements for direct aliases and documentation updates #86 -
quick_df()no longer allowsNULLvalues in the input list #81 -
quick_df()is now a little faster #91 -
list()is now a little faster #91 -
list0()’s functionality to ignore empty inputs can be disabled ifoptions(fuj.list.active = FALSE)before fuj is loaded #91
New functions and methods
-
set_file_ext()andfile_ext<-()added for controlling file extensions #89 -
+and/methods added forfile_pathclasses, allowing path creation (e.g.,fp("folder") / "subfolder" / "file" + "extension") #89 -
hold()andtoss()are added for retaining and removing values in a vectors #85 -
negate()andnot()added to negate functions #84 -
encode()andfact()added to encode values and createfactors #87 -
np()added for normalizing file paths #100 -
fp()no longer normalizes file paths #100 -
match_arg()added for and internally used #102 -
delay()added as a wrapper for passing an expression intoon.exit()(similar towithr::defer()) -
require_namespace()no longer loads the namespace being checked #111 -
BREAKING
require_namespace()now requires<package> <op> <version>to be space delimited. Optionally, alist()can be used with the three components included (e.g.,require_namespace(list("fuj", ">=", "0.2.2"), list("base", "==", getRversion()))
Changes in conditions
General improvements for conditions #90
-
BREAKINGnew_condition(type)now defaults to"condition"rather than"error" -
BREAKINGnew_condition()with a package not uses<package>::<class>names, rather than<package>:<class>names -
new_condition()transformations onclasshave been adjusted- classes are no longer convert to
camelCase; likewise, the basefujConditionclass is nowfuj_condition - classes no longer need their
typespecified (e.g.,my_error,my_warning); the value of thetypefield is automatically appended to each element inclassif it doesn’t already exist. This behavior can be controlled by using anAsIsclass (e.g., class =I("exactly_this_class")) -
classcan now be alistfor more control (e.g.,class = list("value", I("exact value"))) -
new_condition(pkg)is deprecated in favor ofnew_condition(package) -
new_condition(msg)is deprecated in favor ofnew_condition(message);messageis now the first argument -
new_condition()now only acceptsmessage,class, andtypeas positional arguments with the include of...; all other arguments must be explicitly named
- classes are no longer convert to
- default condition functions exported
- include
input_error(),class_error(),value_error(), warning equivalents and more (see all with?fuj::conditions) -
error_condition()/err(),warning_condition()/wrn(),message_condition()/msg()exported for simple conditions (e.g.,message(msg("this is a message"))[#105]
- include
- internally, fuj now simplifies use of
new_condition()- many conditions within fuj have been simplified through the use of generic condition classes (e.g.,
input_error,type_error,class_error) -
verbose_messagewill try to avoid printing a message whenoptions(fuj.verbose = FALSE)is set
- many conditions within fuj have been simplified through the use of generic condition classes (e.g.,
New vap family
Includes new vap family functions; essentially familiar wrappers for apply functions #83
-
vapsare vector apply functions, with certain presets to assist with common cases - all
vapfunctions have type-stable variants:
The below table shows inputs for vap functions and how they behave with the provided functions (f). Arguments to f()) can use any name.
vap function |
f args |
|---|---|
vap(x, f) |
f(x) |
vap2(x, y, f) |
f(x, y) |
vap3(x, y, z, f) |
f(x, y, z) |
vapi(x, f) |
f(x, i) |
vapp(p, f) |
f(...) |
Note: vapi() uses either the index or names of x as the second argument to f.
Each vap function comes with the following type variants. If you are not concerned about type safety, usevap_vec().
| Function | Output Type | Conversion |
|---|---|---|
*_chr() |
character | as.vector(_, "character") |
*_dbl() |
double/numeric | as.vector(_, "double") |
*_int() |
integer | as.vector(_, "integer") |
*_lgl() |
logical | as.vector(_, "logical") |
*_raw() |
raw | as.vector(_, "raw") |
*_cpl() |
complex | as.vector(_, "complex") |
*_date() |
Date | as.Date(as.vector(_, "double"), origin = "1970-01-01") |
*_dttm() |
POSIXct | as.POSIXct(as.vector(_, "double"), origin = "1970-01-01", tz = "UTC") |
Note: these variants do not perform checks on output results, but rather coerce the output to the specified type. These do not function the same as vapply(), which is recommended for more aggressive type checking.
fuj 0.2.2
CRAN release: 2025-04-23
-
require_namespace()now produces a more reasonable error when specifying a version #63 - adds
yes_no()prompting #64 - adds internal
package()utility as the default fornew_condition(pkg = package())#67 -
new_condition()now allowstype = "message"#74 - workflows updated
-
quick_df(list())now works #72 - removes tests for
struct()#78
fuj 0.2.0
CRAN release: 2024-05-07
New features
-
fp()added for creating file path objects withis_path()as a means of checking for the class;file_path()andis_file_path()exported as aliases, respectively #55 -
include()added as a means of partially attaching a package with specific exports #49 -
op.fuj, a named list of default options for fuj is now exported - multiple improvements for
verbose()#50-
verbose()has additional options for controlling the message output #36-
.labelcan be set to a string to prepend to the message (defaults to"[verbose]") -
.fillcan be set to repeat.labelon each line of the message (defaults toFALSE) -
.verbosecan be set toTRUEto print the message rather than relying onoptions()
-
-
verbose()prints prepended with"verbose "instead of"[verbose] "#42 -
make_verbose()is included to create a verbose function that will be triggered with a configured option, rather than the defaultgetOption("fuj.verbose", getOption("verbose"))pattern. This can be used to define your own custom verbose function:
-
-
lst()exported as an alias forlist0()
Internals
-
%||%is now copied from{base}when available (R versions >= 4.4) #35 - additional local testing for os version
-
covr dropped as a
suggestdependency -
require_namespace()now allows for version requirements (e.g.,require_namespace("fuj>=0.1.4")). When the version requirement is not met, an error of classnamespaceVersionErroris returned #41 -
simpleErrors converted to custom errors #43
fuj 0.1.4
CRAN release: 2023-10-22
- adds
%::%and%:::%(which now aliases%colons$) or retrieving exported and non-exported values from namespaces #31 - adds
verbose()for conditional message printing #29 - GitHub workflow added to maintain version bumps on merge
jmbarbone/actions/r-check-version
fuj 0.1.2
CRAN release: 2023-03-06
-
new_condition()gains apkgargument to control for prepending a package name to the condition call. The default value ofTRUEwill try to find the.packageNameobject from your package. Change the default setting ofpkgto prevent this addition. #12 -
require_namespace()can now accept multiple namespaces. The first namespace not found will throw an error #14 -
list0()now correctly throws valid errors #19 - typo fixed in README #20
