cheapr 1.5.0
cheapr 1.5.0 supersedes cheapr 1.4.0
The C/C++ API is currently under development and a
stable release can be expected for cheapr 2.0.0
Note: cheapr 2.0.0 will require C++20
General news
-
Thanks @ChampLeeTX for spotting an issue where the package
wasn't installing for older versions of R. This is now fixed. -
A new rich set of parallelised math functions like
abs_,round_and more. -
New functions for setting and getting the number of threads being used.
-
New multi-threaded vector initialisers like
new_integerandnew_double. -
Plain list vectors are now never regarded as
NAeven if they containNA
elements. -
Parallelisation is internally used more frequently for operations like
creating new vectors, combining vectors, filling, copying and replacing data.
The default has been changed to 2. To use a different number of threads simply
useset_threads() -
scmnow better detects when integer (32-bit and 64-bit) overflow occurs and
switches to using doubles internally, returning a double value. -
if_else_can now handle data frames and is fully SIMD parallelised.
New features
-
The C/C++ API has been re-written to use pure R C API code internally.
-
New function
unique_as a cheaper alternative tounique. -
New function
replace_, a cheaper alternative to[<-for fast
value replacement. -
New functions
cast,cast_common,archetype,archetype_common,r_type
andr_type_commonto help with fast type-stable coercion. -
paste_as a fast alternative tobase::paste. -
New function
na_initto help with fast initialisation of vectors based off
a template vector. -
seq_gains a new argumentsizeto allow for specifying sequences
of exact sizes.
Any combination offrom,to,byandsizecan be specified and are
vectorised. -
Added argument
as_listtoseq_andsequence_to allow the
result to be returned as a list of sequences instead of a vector of combined
sequences. -
New vectorised functions
seq_start,seq_endandseq_incrementto help
with sequence generation. -
New function
is_whole_numberto check that a numeric vector consists
only of whole numbers. -
New function
switch_argsto give more flexibility to developers creating
functions that accept the...argument. -
Exported
cpp_rebuild, a low-level convenience function for rebuilding
attributes from a template. -
New rebuild methods for
tbl_dfandsfobjects.
Bug fixes
-
Fixed a bug in
casethat would return incorrect results when the length of
the RHS was greater than 1. -
Removed all non-API C entry points.
Changes and Improvements
-
ssetis no longer an S3 generic and now internally dispatches on the
correct method. One can still define a subset method for custom objects
via[whichssetfalls back on when it can't find an appropriate method. -
Combining vectors via
c_has been internally made simpler, faster and
utilises type-stable common-casting. -
if_else_has been re-written mostly in C/C++ and should be faster. -
as_dfhas been re-written in C/C++ and now has much lower overhead. -
The
.argsargument now accepts any list, even classed ones. -
rebuild.data.frameandrebuild.data.tablewill now return a data frame
with class'data.frame'andc('data.table', 'data.frame')respectively instead of
returning a data frame with the class of the template data frame. -
Added aliases for all functions named 'cheapr_' to follow the convention of
fn_()wherefn()is the common function they are replacing or improving.
The current alternatives beginning with 'cheapr_' will likely not be deprecated
for a long while. -
sequence_will now recycle thesizeargument additionally to recycling
fromandby. -
Subsetting
sfobjects withssetnow internally calls[.
Breaking changes
-
fastplyr versions 0.9.91 and later must depend on cheapr version 1.4.0 and
later. This means that you can't for example install both fastplyr 0.9.9 and
cheapr 1.3.2 -
Matrices and arrays are explicitly converted to vectors
when using data frames vianew_dfand other data frame constructors.
Since the internal structure of a matrix is a vector with dimension attributes
it is much more efficient to treat it as a vector.
To work with rectangular data in cheapr it is advised to use data frames. -
enframe_(),deframe_()andcut_numeric()have been removed as they have
been deprecated for a while.