Tools for Data Manipulation and Testing


[Up] [Top]

Documentation for package ‘jwutil’ version 1.2.3

Help Pages

A B C D E F G I J L M N O P R S T U Z misc

jwutil-package Tools for testing and data manipulation not found elsewhere

-- A --

add_time_to_date convert separate lists of dates and times to POSIXlt objects
affixFields update a set of data frame field names
areIntegers convert factor or vector to numeric without warnings
areNumeric Which elements of a character vector are numeric
asIntegerNoWarn convert factor or vector to numeric without warnings
as_char_no_warn convert to character vector without warning
as_integer_nowarn convert factor or vector to numeric without warnings
as_numeric_nowarn convert factor or vector to numeric without warnings

-- B --

bad_input bad input data for tests
binary_cols names of fields which are numeric, binary or combinations thereof
binary_col_names names of fields which are numeric, binary or combinations thereof
buildLinearFormula build simple linear formula from variable names
build_formula build simple linear formula from variable names

-- C --

combn_subset all unique combinations of a vector and all its non-zero subsets
countIsNa count NA in vector
countNonNaCumulative running totals of number of non-NA values in consecutive fields
countNotNumeric count non-numeric elements
countNumeric count numeric elements

-- D --

download_to_data_raw Unzip file to 'data-raw'
dput_expect_equal dput a testthat test
dropDuplicateFields Drop fields with duplicate data
dropRowsWithNAField drops rows with NA values in specified fields
drop_duplicate_fields Drop fields with duplicate data
drop_rows_with_na drops rows with NA values in specified fields

-- E --

expect_that_combine_all_args alternative 'expect_that' from 'testthat' which permutes all the inputs to a function which should give the same result where n args >=2 and the function is commutative.
expect_that_combine_first_arg alternative 'expect_that' from 'testthat' which permutes all the inputs to a function which should give the same result where n args >=2 and the function is commutative.
extreme_numbers extreme numbers

-- F --

factorToDataframeLogical Convert factor into a data.frame of logicals
factor_nosort Fast Factor Generation
factor_to_df Convert factor into a data.frame of logicals
fillMissingCombs fill out missing combinations of factors with NA
filterBetter filter data with diagnostics
filter_better filter data with diagnostics
fix_na_ish Fix NA-like strings to be NA (or other value of choice)
flattenList flatten a list

-- G --

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
getNonFactorNames get names of the factor fields in a data frame
getNonNAFields get NA field names from data frame
get_factor_fields get names of the factor fields in a data frame
get_na_fields get NA field names from data frame
get_non_factor_fields get names of the factor fields in a data frame
get_non_na_fields get NA field names from data frame
get_numeric_char_field_names Find columns which are numeric
get_numeric_fields Find columns which are numeric
get_numeric_field_names Find columns which are numeric

-- I --

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
is_integerish convert factor or vector to numeric without warnings
is_na_ish Determine whether a value is, or should be, 'NA'
is_numeric_str Which elements of a character vector are numeric

-- J --

jwutil Tools for testing and data manipulation not found elsewhere
jw_df_basics minimal basic pre-processing metrics
jw_scan_build Build with current Makevars, but with clang scan-build static analysis

-- L --

listTrim trim null or empty values from a list
listTrimFlat trim null or empty values from a list
list_named Make a list using input argument names as names
logicalToBinary Convert logical columns of data frame to 0s and 1s
logical_to_binary Convert logical columns of data frame to 0s and 1s
ls.objects Summarize objects
lsf list all functions in a package
lsos show largest objects
lsp List all items in a package

-- M --

match_multi Match across columns for multiple lookup values
mergeBetter Merge better
mergeLists merge lists by names
merge_better Merge better
min_r_version Find minimum R version required for package

-- N --

npc Print integers with percentage of total rounded to integer
numbers_to_long_and_float convert numbers to long and float types

-- O --

opt_binary_brute selects columns from a data frame using an optimization function

-- P --

percentize Convert a number into rounded integer percentage string
percent_signif Return percentage string to given significant figures
permute Generate all permutations of input
permuteWithRepeats Generate all permutations of input, reusing values in each result row
platformIsLinux Are we running on Linux, Mac or Windows?
platformIsMac Are we running on Linux, Mac or Windows?
platformIsWindows 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

-- R --

random_test_dates generate random Dates or POSIXlt test datetimes
random_test_integers create extreme random numbers
random_test_letters create extreme random numbers
random_test_numbers create extreme random numbers
random_test_posixlt_datetimes generate random Dates or POSIXlt test datetimes
read.zip.url read file from zip at URL
read_xlsx_linux read '.xlsx' file, interpret as CSV, and return a data frame
read_zip_url read file from zip at URL
reqinst Load packages with 'library', installing any which are missing
rm_r recursive remove

-- S --

save_in_data_dir Save given variable in package data directory
shuffle Shuffle a vector
sort_clip_char Take clipboard contents, and write sorted character vector back
source_purl Extract code from knitr vignette and source it
strip strip all whitespace
strip_for_formula strip a string so that it can be used as a variable name in a formula.
strMultiMatch return the actual matches from a bracketed regex
str_multi_match return the actual matches from a bracketed regex

-- T --

trim strip whitespace from ends of each string in given character vector
two_cat_cols names of fields which are numeric, binary or combinations thereof
two_cat_col_names names of fields which are numeric, binary or combinations thereof
two_cat_to_logical Take dataframe, and convert any columns with just two categories into logical

-- U --

unzip_single unzip a single file from URL
unzip_to_data_raw Unzip file to 'data-raw'
update_github_pkgs Update github_install packages

-- Z --

zeroes zeroes
zero_na Zero NA values in a data.frame

-- misc --

%nin% inverse of %in%