| NEWS | R Documentation | 
News for R Package kit
version 0.0.20 (2025-04-17)
Notes
- Update copyright date in c files 
- Fix note on CRAN regarding Rf_isFrame 
version 0.0.19 (2024-09-07)
Bug Fixes
- Fix multiple warnings in C code. 
version 0.0.18 (2024-06-06)
Bug Fixes
- Fix - iiftests for new version of R.
version 0.0.17 (2024-05-03)
Bug Fixes
- Fix - nswitch. Thanks to Sebastian Krantz for raising an issue.
Notes
- Update copyright date in c files 
- Fix note on CRAN regarding SETLENGTH 
version 0.0.16 (2024-03-01)
Notes
- Check if - "kit.nThread"is defined before setting it to- 1L
version 0.0.15 (2023-10-01)
Notes
- Correct typo in configure file 
version 0.0.14 (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 
version 0.0.13 (2023-02-24)
Notes
- Function - pprodnow returns double output even if inputs are integer - in line with- base::prod- to avoid integer overflows.
- Update configure file 
version 0.0.12 (2022-10-26)
New Features
- Function - pcountNAis equivalent to- pcount(..., value = NA).
- Function - pcountNAand- pcount(..., value = NA)allow- NAcounting with mixed data type (including- data.frame).- pcountNAalso supports list-vectors as inputs and counts empty or- NULLelements as- NA.
- Functions - panyv,- panyNA,- pallvand- pallNAare added as efficient wrappers around- pcountand- pcountNA. They are parallel equivalents of scalar functions- base::anyNAand- anyv,- allvand- allNAin the 'collapse' R package.
- Functions - pfirstand- plastare 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)- ffirstand- flastfunctions 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 with- base::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. 
version 0.0.11 (2022-03-19)
New Features
- Function - pcountnow supports data.frame.
Bug Fixes
- Function - pcountnow works with specific NA values, i.e. NA_real_, NA_character_ etc...
version 0.0.10 (2021-11-28)
New Features
- Function - psum,- pmean,- pprod,- panyand- pallnow 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.
version 0.0.9 (2021-09-12)
Notes
- Re-organise header to prevent compilation errors with new version of Clang due to conflicts between R C headers and OpenMP. 
version 0.0.8 (2021-08-21)
New Features
- Function - funiquenow preserves the attributes if the input is a- data.table,- tibbleor similar objects. Thanks to Sebastian Krantz for the request.
- Function - topnnow defaults to base R- orderfor large value of- n. Please see updated documentation for more information- ?kit::topn.
- Function - charToFactgains a new argument- addNA=TRUEto be used to include (or not)- NAin levels of the output.
- Function - shareData,- getDataand- clearDataimplemented 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.
Notes
- Few - callocfunctions at C level have been replaced by R C API function- Callocto avoid valgrind errors/warnings in Travis CI.
- Errors reported by - rchkon CRAN have been fixed.
version 0.0.7 (2021-03-07)
New Features
- Function - charToFactgains a new argument- decreasing=FALSEto be used to order levels of the output in decreasing or increasing order.
- Function - topngains a new argument- index=TRUEto be used return index (- TRUE) or values (- FALSE) of input vector.
Bug Fixes
- Some tests of memory access errors using valgrind and AddressSanitizer were reported by CRAN. An attempt to fix these errors has been submitted as part of this package version. It also seems that these same errors were causing some tests to fail for - funiqueand- psorton some platforms.
Notes
- Functions - pmean,- pprodand- psumwill result in error if used with factors. Documentation has been updated.
version 0.0.6 (2021-02-21)
New Features
- Function - funiqueand- fduplicatedgain an additional argument- fromLast=FALSEto indicate whether the search should start from the end or beginning PR#11.
- Functions - pall,- pany,- pmean,- pprodand- psumaccept- data.frameas input PR#15. Please see documentation for more information.
- Function - charToFactis equivalent to to base R- as.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 R- sortbut 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 - vswitchand- nswitchfor 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 - funiqueand- uniqLenshould now be faster for- factorand- logicalvectors PR#14.
version 0.0.5 (2020-11-21)
New Features
- Function - uniqLen(x)is equivalent to base R- length(unique(x))and- uniqueNin package data.table. Function- uniqLen, implemented in C, supports vectors,- data.frameand- matrix. 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 argument- checkEnc=TRUE. Thanks to Xianying Tan (@shrektan) for the request and review PR#7.
- Function - nswitchis a nested version of function- vswitchand also supports mixed encoding. Please see please see- ?kit::nswitchfor further details. Thanks to Xianying Tan (@shrektan) for the request and review PR#10.
Notes
- Small algorithmic improvement for functions - fduplicated,- funiqueand- countOccurfor- vectors,- data.frameand- matrix.
- A tests folder has been added to the source package to track coverage and bugs. 
C-Level Facilities
- Function - nifhas been split into two distinctive functions at C level, one has its arguments evaluated in a lazy way and is for R users and the other one (nifInternalR) is not lazy and is intended for usage at C level.
version 0.0.4 (2020-07-21)
New Features
- Function - countOccur(x), implemented in C, is comparable to- baseR function- table. It returns a- data.frameand is between 3 to 50 times faster. For more details, please see- ?kit::countOccur.
- Functions - funiqueand- fduplicatednow support matrices. Additionally, these two functions should also have better performance compare to previous release.
- Functions - topnhas an additional argument- hasna=TRUEto indicates whether data contains- NAvalue or not. If the data does not contain- NAvalues, the function should be faster.
C-Level Facilities
- A few C functions have been added to subset - data.frameand- matrixas 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 handling- NaNand- NAfor 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 - funiqueand- fduplicatedwere not properly handling data containing- POSIXdata. This has now been fixed.
version 0.0.3 (2020-06-21)
New Features
- Functions - fduplicated(x)and- funique(x), implemented in C, are comparable to- baseR functions- duplicatedand- unique. For more details, please see- ?kit::funique.
- Functions - psumand- pprodhave now better performance for type double and complex.
Bug Fixes
- Function - count(x, y)now checks that- xand- yhave the same class and levels. So does- pcount.
- Function - pmeanwas not callable at C level because of a typo. This is now fixed.
version 0.0.2 (2020-05-22)
New Features
- Function - count(x, value), implemented in C, to simply count the number of times an element- valueoccurs in a vector or in a list- x. For more details, please see- ?kit::count.
- Function - pmean(..., na.rm=FALSE),- pall(..., na.rm=FALSE),- pany(..., na.rm=FALSE)and- pcount(..., value), implemented in C, are similar to already available function- psumand- pprod. These functions respectively apply base R functions- mean,- alland- anyelement-wise. For more details, benchmarks and help, please see- ?kit::pmean.
Bug Fixes
- Fix Solaris Unicode warnings for NEWS file. Benchmarks have been moved from the NEWS file to each function Rd file. 
- Fix some - NAedge cases for- pprodand- psumso these functions behave more like base R function- prodand- sum.
- Fix installation errors for version of R (<3.5.0). 
version 0.0.1 (2020-05-03)
Initial Release
- Function - fpos(needle, haystack, all=TRUE, overlap=TRUE), implemented in C, is inspired by base function- whichwhen used in the following form- which(x == y, arr.ind =TRUE). Function- fposreturns 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 as- fifelsein package data.table, was moved to package kit to be developed independently. Unlike the current version of- fifelse,- iifallows type promotion like base function- ifelse. For further details about the differences with- fifelse, as well as- hutils::if_elseand- dplyr::if_else, please see- ?kit::iif.
- Function - nif(..., default=NULL), implemented in C, is inspired by SQL CASE WHEN. It is comparable to dplyr function- case_whenhowever it evaluates it arguments in a lazy way (i.e only when needed). Function- nifwas originally contributed as function- fcasein 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)and- psum(..., na.rm=FALSE), implemented in C, are inspired by base function- pminand- pmax. 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 smallest- nvalues for a given numeric vector- vec. It is inspired by- dplyr::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 of- baseR function- switch. This function can also be seen as a particular case of function- nif. Please see- ?kit::switchfor more details.