Learn R Programming

taRifx (version 1.0.6.2)

Collection of Utility and Convenience Functions

Description

A collection of various utility and convenience functions.

Copy Link

Version

Install

install.packages('taRifx')

Monthly Downloads

103

Version

1.0.6.2

License

GPL (>= 2)

Maintainer

Last Published

March 29th, 2020

Functions in taRifx (1.0.6.2)

iapply

Iteratively (recursively) apply a function to its own output
bytable

Produces a nice summary table by groupings
homogenous

Returns whether a vector is homogenous or not
readdir

Loads all readable files in a directory into a list, with names according to the filenames
categorize

Categorize a vector based on a data.frame with two columns, the low and high end points of each category.
sort.data.frame

Sort a data.frame
remove.factors

Converts all factors in a data.frame to character.
splitc

Split data over columns
hist_horiz

Kludgy horizontal histogram function (really should just fix the lattice equivalent)
last

Convenience functions to return the last/first element of a vector
rep_along

Repeat a vector until it matches the length of another vector
daysofweek

Return a vector of the days of the week, in order
munch

Recursively delete entries containing `what` before entry pointed to by `which`
middle.group

Return a vector containing the locations of the middle of every group in a vector, either as a numerical index or as a TRUE/FALSE boolean.
compareplot

Bar plot divided by three groupings
japply

japply: Judiciously sapply to only selected columns
shift

Shifts a vector's elements left or right by N elements.
sides

Figure out how many "sides" a formula has See also SimonO101's answer at http://stackoverflow.com/a/16376939/636656
fpart

Obtain the fractional part of a numeric
roundnear

Rounds a numeric vector to arbitrary values (not just decimal values as with round) or to a specified number of significant digits.
latex.table.by

Exports a latex table with the first N columns being multirow grouping variables.
panel.ecdf

Various panel functions
autoplot.microbenchmark

Autoplot method for microbenchmark objects: Prettier graphs for microbenchmark using ggplot2
between

Classify values into groups based on which numbers they're between
unfactor.data.frame

Convert all factors to character
prettify

Function to prettify the output of another function using a `var.labels` attribute This is particularly useful in combination with read.dta et al.
xtable.CrossTable

Add in methods to handle CrossTable objects in xtable
xtablelm

Produces the output of an lm object as it appears in the R console when you type summary(lmobject)
write.sanitized.csv

Outputs a sanitized CSV file for fussy input systems e.g. ArcGIS and Mechanical Turk Performs three cleansing actions: converts text to latin1 encoding, eliminates funny characters in column names, and writes a CSV without the leading row.names column
destring

Convert character vector to numeric, ignoring irrelevant characters.
distinct

Returns number of distinct observations in each column of a data frame or in a vector
as.data.frame.by

Convert the results of by() to a data.frame.
title.page.new

Plot a title page containing the given text. Good for breaking up sections of plot PDFs.
merge.list

Method to merge two lists Matches names of each list element and combines any sub-elements
xtable.lme

Add in methods to handle LME objects in xtable
reshapeasy

reshapeasy: Easier reshaping from "wide" to "long" and back again
evens

Shortcut functions to return the odd and even values from a vector
trues

Return vector of equal length containing all TRUEs
stack.list

Stack lists into data.frames
tab

Table function which lists NA entries by default This is a simple wrapper to change defaults from the base R table()
expandDF

Functions to manipulate data frames
as.matrix.by

Coerces a by object into a matrix (only tested on a 2d objects).
searchPattern

Create a vector that starts with a given number and widens out