jwutil: Tools for Data Manipulation and Testing

This is a set of simple utilities for various data manipulation and testing tasks. The goal is to use base tools well, without bringing in many dependencies. Main areas of interest are semi-automated data frame manipulation, such as converting factors in multiple binary indicator columns. There are testing functions which provide 'testthat' expectations to permute arguments to function calls. There are functions and data to test extreme numbers, dates, and bad input of various kinds which should allow testing failure and corner cases, which can be used for fuzzing your functions. The test suite has many examples of usage.

AuthorJack O. Wasey [aut, cre, cph]
Date of publication2016-10-18 10:46:33
MaintainerJack O. Wasey <jack@jackwasey.com>
LicenseGPL-3
Version1.1.1
https://github.com/jackwasey/jwutil

View on CRAN

Man pages

add_time_to_date: convert separate lists of dates and times to POSIXlt objects

affixFields: update a set of data frame field names

allIsInteger: check whether vector represents all integer values, not that...

allIsNumeric: check whether character vector represents all numeric values

areNumeric: which elements of a vector are numeric

asCharacterNoWarn: convert factor or vector to character without warnings

asNumericNoWarn: convert factor or vector to numeric without warnings

bad_input: bad input data for tests

binary_col_names: names of fields which are numeric, binary or combinations...

buildLinearFormula: build simple linear formula from variable names

combn_subset: all unique combinations of a vector and all its non-zero...

countIsNa: count NA in vector

countNonNaCumulative: running totals of number of non-NA values in consecutive...

countNonNaPairs: count which combinations of fields have at least one non-NA

countNotNumeric: count non-numeric elements

countNumeric: count numeric elements

dput_expect_equal: dput a testthat test

dropDuplicateFields: drop duplicate fields

dropRowsWithNAField: drops rows with NA values in specified fields

expandFactors: Takes factors from a data frame and converts them to...

expect_that_combine_all_args: alternative 'expect_that' from 'testthat' which permutes all...

extreme_numbers: extreme numbers

factorToDataframeLogical: convert factor into a data.frame of logicals

fillMissingCombs: fill out missing combinations of factors with NA

filterBetter: filter data with diagnostics

flattenList: flatten a list

getDropped: get items or numerics that would be dropped in a merge

getFactorNames: get names of the factor fields in a data frame

getNAFields: get NA field names from data frame

grapes-nin-grapes: inverse of %in%

invwhich: inverse which

is.Date: is the object a 'Date'

isFlat: determine whether a list is nested

isRowSorted: is every row sorted?

isValidTime: check if a time is valid in 24h clock

jwutil-package: Tools for data manipulation not found elsewhere, and testthat...

listTrim: trim null or empty values from a list

listTrimFlat: trim null or empty values from a list

logicalToBinary: encode TRUE as 1, and FALSE as 0 (integers)

lsf: list all functions in a package

lsos: show largest objects

lsp: list all items in a package

mergeBetter: merge better

mergeLists: merge lists by names

numbers_to_long_and_float: convert numbers to long and float types

opt_binary_brute: optimizes a function for all combinations of all subsets

permute: generate all permutations of input

permuteWithRepeats: generate all permutations of input, reusing values in each...

platformIsLinux: Are we running on Linux, Mac or Windows?

propIsNa: Proportion of NA values in a vector

propNaPerField: return proportion of NA values per field

propRowSorted: proportion of non-descending rows in matrix

random_test_dates: generate random Dates or POSIXlt test datetimes

random_test_numbers: create extreme random numbers

read_xlsx_linux: read '.xlsx' file, interpret as CSV, and return a data frame

read.zip.url: read file from zip at URL

rm_r: recursive remove

save_in_data_dir: Save given variable in package data directory

set_attr_in_place: Set attribute on any SEXP in place

shuffle: shuffle

source_purl: extract code from knitr vignette and source it

strip: strip all whitespace

stripForFormula: strip a string so that it can be used as a variable name in a...

strMultiMatch: return the actual matches from a bracketed regex

trim: strip whitespace from ends of each string in given character...

zeroes: zeroes

zero_na: zero NA values in a data.frame

Functions

add_time_to_date Man page
affixFields Man page
allIsInteger Man page
allIsNumeric Man page
areIntegers Man page
areNumeric Man page
asCharacterNoWarn Man page
asIntegerNoWarn Man page
asNumericNoWarn Man page
bad_input Man page
binary_col_names Man page
binary_cols Man page
buildLinearFormula Man page
combn_subset Man page
countIsNa Man page
countNonNaCumulative Man page
countNonNaPairs Man page
countNotNumeric Man page
countNumeric Man page
dput_expect_equal Man page
dropDuplicateFields Man page
dropRowsWithNAField Man page
expandFactors Man page
expect_that_combine_all_args Man page
expect_that_combine_first_arg Man page
extreme_numbers Man page
factorToDataframeLogical Man page
fillMissingCombs Man page
filterBetter Man page
flattenList Man page
getDropped Man page
getFactorNames Man page
getNAFields Man page
getNonFactorNames Man page
getNonNAFields Man page
invwhich Man page
is.Date Man page
isFlat Man page
isRowSorted Man page
isValidTime Man page
jwutil Man page
jwutil-package Man page
listTrim Man page
listTrimFlat Man page
logicalToBinary Man page
lsf Man page
lsos Man page
lsp Man page
mergeBetter Man page
mergeLists Man page
\%nin\% Man page
numbers_to_long_and_float Man page
numeric_col_names Man page
numeric_cols Man page
opt_binary_brute Man page
permute Man page
permuteWithRepeats Man page
platformIsLinux Man page
platformIsMac Man page
platformIsWindows Man page
propIsNa Man page
propNaPerField Man page
propRowSorted Man page
random_test_dates Man page
random_test_integers Man page
random_test_letters Man page
random_test_numbers Man page
random_test_posixlt_datetimes Man page
read_xlsx_linux Man page
read.zip.url Man page
rm_r Man page
save_in_data_dir Man page
set_attr_in_place Man page
shuffle Man page
source_purl Man page
strip Man page
stripForFormula Man page
strMultiMatch Man page
strPairMatch Man page
trim Man page
zeroes Man page
zero_na Man page

Files

jwutil
jwutil/tests
jwutil/tests/testthat
jwutil/tests/testthat/test-df.R
jwutil/tests/testthat/test-merge.R
jwutil/tests/testthat/test-char.R
jwutil/tests/testthat/test-testing.R
jwutil/tests/testthat/test-lint.R
jwutil/tests/testthat/test-util.R
jwutil/tests/testthat/test-list.R
jwutil/tests/test-all.R
jwutil/src
jwutil/src/attr.cpp
jwutil/src/rowsorted.cpp
jwutil/src/RcppExports.cpp
jwutil/NAMESPACE
jwutil/R
jwutil/R/testing.r
jwutil/R/dput_expect_that.r
jwutil/R/list.r
jwutil/R/RcppExports.R
jwutil/R/jwutil-package.r
jwutil/R/util.r
jwutil/R/char.r
jwutil/R/df.r
jwutil/README.md
jwutil/MD5
jwutil/DESCRIPTION
jwutil/man
jwutil/man/random_test_dates.Rd jwutil/man/allIsNumeric.Rd jwutil/man/lsf.Rd jwutil/man/add_time_to_date.Rd jwutil/man/platformIsLinux.Rd jwutil/man/getDropped.Rd jwutil/man/propRowSorted.Rd jwutil/man/combn_subset.Rd jwutil/man/isValidTime.Rd jwutil/man/countNonNaCumulative.Rd jwutil/man/extreme_numbers.Rd jwutil/man/propNaPerField.Rd jwutil/man/jwutil-package.Rd jwutil/man/affixFields.Rd jwutil/man/mergeLists.Rd jwutil/man/countNotNumeric.Rd jwutil/man/isFlat.Rd jwutil/man/zero_na.Rd jwutil/man/rm_r.Rd jwutil/man/strip.Rd jwutil/man/set_attr_in_place.Rd jwutil/man/read_xlsx_linux.Rd jwutil/man/propIsNa.Rd jwutil/man/dput_expect_equal.Rd jwutil/man/buildLinearFormula.Rd jwutil/man/isRowSorted.Rd jwutil/man/fillMissingCombs.Rd jwutil/man/dropRowsWithNAField.Rd jwutil/man/strMultiMatch.Rd jwutil/man/logicalToBinary.Rd jwutil/man/factorToDataframeLogical.Rd jwutil/man/binary_col_names.Rd jwutil/man/permute.Rd jwutil/man/opt_binary_brute.Rd jwutil/man/zeroes.Rd jwutil/man/grapes-nin-grapes.Rd jwutil/man/expect_that_combine_all_args.Rd jwutil/man/read.zip.url.Rd jwutil/man/listTrim.Rd jwutil/man/random_test_numbers.Rd jwutil/man/countNonNaPairs.Rd jwutil/man/filterBetter.Rd jwutil/man/listTrimFlat.Rd jwutil/man/getNAFields.Rd jwutil/man/trim.Rd jwutil/man/flattenList.Rd jwutil/man/is.Date.Rd jwutil/man/countNumeric.Rd jwutil/man/lsp.Rd jwutil/man/asCharacterNoWarn.Rd jwutil/man/areNumeric.Rd jwutil/man/expandFactors.Rd jwutil/man/allIsInteger.Rd jwutil/man/countIsNa.Rd jwutil/man/invwhich.Rd jwutil/man/dropDuplicateFields.Rd jwutil/man/save_in_data_dir.Rd jwutil/man/lsos.Rd jwutil/man/asNumericNoWarn.Rd jwutil/man/getFactorNames.Rd jwutil/man/source_purl.Rd jwutil/man/stripForFormula.Rd jwutil/man/bad_input.Rd jwutil/man/mergeBetter.Rd jwutil/man/permuteWithRepeats.Rd jwutil/man/numbers_to_long_and_float.Rd jwutil/man/shuffle.Rd

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.