Changelog
Source:NEWS.md
kit 0.0.14 (2023-08-12)
CRAN release: 2023-08-12
Notes
Update configure file to extend support for GCC
Correct warnings in NEWS.Rd (strong)
Correct typo in funique.Rd thanks to @davidbudzynski
kit 0.0.13 (2023-02-24)
CRAN release: 2023-02-24
Notes
Function
pprodnow returns double output even if inputs are integer - in line withbase::prod- to avoid integer overflows.Update configure file
kit 0.0.12 (2022-10-26)
CRAN release: 2022-10-26
New Features
Function
pcountNAis equivalent topcount(..., value = NA).Function
pcountNAandpcount(..., value = NA)allowNAcounting with mixed data type (includingdata.frame).pcountNAalso supports list-vectors as inputs and counts empty orNULLelements asNA.Functions
panyv,panyNA,pallvandpallNAare added as efficient wrappers aroundpcountandpcountNA. They are parallel equivalents of scalar functionsbase::anyNAandanyv,allvandallNAin the ‘collapse’ R package.Functions
pfirstandplastare added to efficiently obtain the row-wise first and last non-missing value or non-empty element of lists. They are parallel equivalents to the (column-wise)ffirstandflastfunctions in the ‘collapse’ R package. Implemented by @SebKrantz.Functions
psum/pprod/pmeanalso support logical vectors as input. Implemented by @SebKrantz.
Bug Fixes
- Function
charToFactwas not returning proper results. Thanks to @alex-raw for raising an issue.
Notes
Function
pprodnow returns double output even if inputs are integer - in line withbase::prod- to avoid integer overflows.C compiler warnings on CRAN R-devel caused by compilation with -Wstrict-prototypes are now fixed. Declaration of functions without prototypes is depreciated in all versions of C. Thanks to Sebastian Krantz for the PR.
kit 0.0.10 (2021-11-28)
CRAN release: 2021-11-28
New Features
- Function
psum,pmean,pprod,panyandpallnow support lists. Thanks to Sebastian Krantz for the request and code suggestion.
Bug Fixes
- Function
topnshould now work for ALTREP object. Thanks to @ben-schwen for raising an issue.
kit 0.0.8 (2021-08-21)
CRAN release: 2021-08-17
New Features
Function
funiquenow preserves the attributes if the input is adata.table,tibbleor similar objects. Thanks to Sebastian Krantz for the request.Function
topnnow defaults to base Rorderfor large value ofn. Please see updated documentation for more information?kit::topn.Function
charToFactgains a new argumentaddNA=TRUEto be used to include (or not)NAin levels of the output.Function
shareData,getDataandclearDataimplemented to share data objects between R sessions. These functions are experimental and might change in the future. Feedback is welcome. Please see?kit::shareDatafor more information.
kit 0.0.7 (2021-03-07)
CRAN release: 2021-03-09
New Features
Function
charToFactgains a new argumentdecreasing=FALSEto be used to order levels of the output in decreasing or increasing order.Function
topngains a new argumentindex=TRUEto be used return index (TRUE) or values (FALSE) of input vector.
kit 0.0.6 (2021-02-21)
CRAN release: 2021-02-21
New Features
Function
funiqueandfduplicatedgain an additional argumentfromLast=FALSEto indicate whether the search should start from the end or beginning PR#11.Functions
pall,pany,pmean,pprodandpsumacceptdata.frameas input PR#15. Please see documentation for more information.Function
charToFactis equivalent to to base Ras.factorbut is much quicker and only converts character vector to factor. Note that it is parallelised. For more details and benchmark please see?kit::charToFact.Function
psortis experimental and equivalent to to base Rsortbut is only for character vector. It can sort by “C locale” or by “R session locale”. For more details and benchmark please see?kit::psort.
Notes
A few OpenMP directives were missing for functions
vswitchandnswitchfor character vectors. These have been added in PR#12.Function
funiquewas not preserving attributes for character, logical and complex vectors/data.frames. Thanks to Sebastian Krantz (@SebKrantz) for bringing that to my attention. This has been fixed in PR#13.Functions
funiqueanduniqLenshould now be faster forfactorandlogicalvectors PR#14.
kit 0.0.5 (2020-11-21)
CRAN release: 2020-11-21
New Features
Function
uniqLen(x)is equivalent to base Rlength(unique(x))anduniqueNin package data.table. FunctionuniqLen, implemented in C, supports vectors,data.frameandmatrix. It should be faster than these functions. For more details and benchmark please see?kit::uniqLen.Function
vswitchnow supports mixed encoding and gains an additional argumentcheckEnc=TRUE. Thanks to Xianying Tan (@shrektan) for the request and review PR#7.Function
nswitchis a nested version of functionvswitchand also supports mixed encoding. Please see please see?kit::nswitchfor further details. Thanks to Xianying Tan (@shrektan) for the request and review PR#10.
kit 0.0.4 (2020-07-21)
CRAN release: 2020-07-21
New Features
Function
countOccur(x), implemented in C, is comparable tobaseR functiontable. It returns adata.frameand is between 3 to 50 times faster. For more details, please see?kit::countOccur.Functions
funiqueandfduplicatednow support matrices. Additionally, these two functions should also have better performance compare to previous release.Functions
topnhas an additional argumenthasna=TRUEto indicates whether data containsNAvalue or not. If the data does not containNAvalues, the function should be faster.
C-Level Facilities
- A few C functions have been added to subset
data.frameandmatrixas well as do other operations. These functions are not exported or visible to the user but might become available and callable at C level in the future.
Bug Fixes
Function
fposwas not properly handlingNaNandNAfor complex and double. This should now be fixed. The function has also been changed in case the ‘needle’ and ‘haysatck’ are vectors so that a vector is returned.Functions
funiqueandfduplicatedwere not properly handling data containingPOSIXdata. This has now been fixed.
kit 0.0.3 (2020-06-21)
CRAN release: 2020-06-26
New Features
Functions
fduplicated(x)andfunique(x), implemented in C, are comparable tobaseR functionsduplicatedandunique. For more details, please see?kit::funique.Functions
psumandpprodhave now better performance for type double and complex.
kit 0.0.2 (2020-05-22)
CRAN release: 2020-05-24
New Features
Function
count(x, value), implemented in C, to simply count the number of times an elementvalueoccurs in a vector or in a listx. For more details, please see?kit::count.Function
pmean(..., na.rm=FALSE),pall(..., na.rm=FALSE),pany(..., na.rm=FALSE)andpcount(..., value), implemented in C, are similar to already available functionpsumandpprod. These functions respectively apply base R functionsmean,allandanyelement-wise. For more details, benchmarks and help, please see?kit::pmean.
kit 0.0.1 (2020-05-03)
CRAN release: 2020-05-08
Initial Release
Function
fpos(needle, haystack, all=TRUE, overlap=TRUE), implemented in C, is inspired by base functionwhichwhen used in the following formwhich(x == y, arr.ind =TRUE). Functionfposreturns the index(es) or position(s) of a matrix/vector within a larger matrix/vector. Please see?kit::fposfor more details.Function
iif(test, yes, no, na=NULL, tprom=FALSE, nThread=getOption("kit.nThread")), originally contributed asfifelsein package data.table, was moved to package kit to be developed independently. Unlike the current version offifelse,iifallows type promotion like base functionifelse. For further details about the differences withfifelse, as well ashutils::if_elseanddplyr::if_else, please see?kit::iif.Function
nif(..., default=NULL), implemented in C, is inspired by SQL CASE WHEN. It is comparable to dplyr functioncase_whenhowever it evaluates it arguments in a lazy way (i.e only when needed). Functionnifwas originally contributed as functionfcasein the data.table package but then moved to package kit so its development may resume independently. Please see?kit::niffor more details.Function
pprod(..., na.rm=FALSE)andpsum(..., na.rm=FALSE), implemented in C, are inspired by base functionpminandpmax. These new functions work only for integer, double and complex types and do not recycle vectors. Please see?kit::psumfor more details.Function
setlevels(x, old, new, skip_absent=FALSE), implemented in C, may be used to set levels of a factor object. Please see?kit::setlevelsfor more details.Function
topn(vec, n=6L, decreasing=TRUE), implemented in C, returns the top largest or smallestnvalues for a given numeric vectorvec. It is inspired bydplyr::top_nand equivalent to base functions order and sort in specific cases as shown in the documentation. Please see?kit::topnfor more details.Function
vswitch(x, values, outputs, default=NULL, nThread=getOption("kit.nThread")), implemented in C, is a vectorised version ofbaseR functionswitch. This function can also be seen as a particular case of functionnif. Please see?kit::switchfor more details.