Fast and Memory-Efficient Base R Table Manipulation


[Up] [Top]

Documentation for package ‘basetable’ version 1.3.2

Help Pages

A B C D E F H I J K L M N O P Q R S T U W Y

basetable-package Base-Faithful Tabular Data Tools

-- A --

adddays Add days to a date
addedrows Rows present in 'new' but not in 'old'
addmonths Add months to a date
addweeks Add weeks to a date
addyears Add years to a date
aggregate Aggregate values by group
antimerge Anti-join two tables
applyby Apply a function to each group
applycols Apply a function to selected columns
assertcols Assert that columns exist (alias)
assertcomplete Assert that there are no missing values
assertkey Assert that a key is unique (alias)
assertnames Assert that required column names are present
assertrange Assert that a column falls within a numeric range
assertrows Assert that a row-wise condition holds for every row
asserttype Assert that a column has an expected class
assertunique Assert that selected columns are unique
assertvalues Assert that a column only contains allowed values
assert_cols Validation and schema helpers
assert_key Validation and schema helpers

-- B --

basetable Base-Faithful Tabular Data Tools
betweendates Test whether a date falls within a range
blanktona Recode blank strings to 'NA'
btread Read a delimited text file
btwrite Write a data frame to a delimited text file

-- C --

cardinality Distinct-value count (or proportion) per column
casewhen Multi-branch selection by condition
ceilingdate Round a date up to a unit
center Center a vector at its mean
changedcols Compare the columns of two tables
changedrows Rows whose key appears in both tables
classes Column classes
cleannames Clean column names to a unique, syntactic form
collapselevels Collapse factor levels into named groups
collapsetext Collapse a vector into a single string
collapsevalues Collapse values into named groups
colnames Column names
commonnames Column names shared by two tables
common_names Validation and schema helpers
compare Compare tables
compareschema Compare the schemas of two tables
completegrid Complete a table grid
constants Columns with a single distinct non-missing value
containstext Test for a pattern match anywhere in the string
convertcols Convert selected columns with a function
count Count rows by group
countmatch Count pattern matches per string
crossmerge Cartesian join two tables
cumavg Cumulative mean
cumcount Cumulative row counter
cumedist Cumulative empirical distribution

-- D --

datediff Difference between two dates
dateseq Sequence of dates
day Extract the day of month
denserank Dense rank of a vector
describe Column descriptions
difference Lagged difference
diffrows Set difference of rows
dims Table dimensions
drop Drop columns
duplicated_keys Validation and schema helpers
duplicatekeys Duplicated key combinations
duplicatenames Duplicated column names
duplicaterows Rows involved in a duplicate

-- E --

emptycols Columns that are entirely blank or missing
emptyrows Rows that are entirely blank or missing
endswith Test whether strings end with a pattern
equaldata Compare two tables for equality
equalrows Compare two tables' rows for equality
expandlevels Add levels to a factor
expandrows Repeat rows in a table
extract Extract the first pattern match
extractall Extract all pattern matches
extractbetween Extract text between two markers
extractint Extract an integer value from text
extractnum Extract a numeric value from text

-- F --

fillboth Fill missing values both forward and backward within groups
filldown Fill missing values downward
fillup Fill missing values upward
firstby First row within each group
firstcols Move columns to the front
firstrows First 'n' rows
floordate Round a date down to a unit
foldr Fold a vector or list from the right
freq Frequency table

-- H --

headtail Head and tail rows
hour Extract the hour

-- I --

intersectrows Set intersection of rows
invalidrows Rows that fail a condition
invalidvalues Rows whose value is not in the allowed set
isalpha Test for alphabetic-only strings
isalphanumeric Test for alphanumeric-only strings
isblank Test for blank (missing or empty) values
isemail Test whether text looks like an email address
isintegertext Test whether text looks like an integer
isnumerictext Test whether text looks numeric
isurl Test whether text looks like a URL

-- J --

joinrelationship Cardinality of a join key relationship
jointext Concatenate values element-wise

-- K --

keepmissing Keep rows with missing values

-- L --

lagvalue Lag a vector
lastby Last row within each group
lastcols Move columns to the back
lastrows Last 'n' rows
leadvalue Lead a vector
left First 'n' characters
locate Position of the first pattern match
locateall Positions of all pattern matches
lower Convert to lower case
lump Lump infrequent values into "Other"

-- M --

map Map over vectors and lists
matchedkeys Rows of 'x' whose key is present in 'y'
matchestext Test for a full-string pattern match
merge Merge two tables
middle Substring between two positions
minute Extract the minute
missingindicator Add missingness indicators
missingness Summarize missing values by column or row
missingrows Return rows with missing values
month Extract the month
move Move columns before or after another column

-- N --

naif Recode matching values to 'NA'
nato Replace 'NA' with a value
natoblank Replace 'NA' with an empty string
ncols Number of columns
nearestmerge Nearest-key join
nearesttext Nearest string match
nonequimerge Merge two tables using non-equi (inequality) conditions
normalizeencoding Normalize text encoding to UTF-8
normalizeunicode Normalize Unicode text
nrows Number of rows

-- O --

omitmissing Drop rows with missing values
orderrows Order rows by one or more columns
outofrange Rows whose value falls outside a range
overlapmerge Merge tables on overlapping intervals

-- P --

padcenter Pad text on both sides
padleft Pad text on the left
padright Pad text on the right
parsecurrency Parse a currency string as a number
parsedate Parse text as dates, trying multiple formats
parsedatetime Parse text as date-times, trying multiple formats
parsefailures Rows where parsing failed
parseint Parse text as integers
parselogical Parse text as logicals
parsenum Parse text as numbers
parsepercent Parse a percentage string as a number
percentchange Period-over-period percent change
percentrank Percentile rank of a vector
pick Select columns
preview Compact table preview
profile Compact variable profile
propcount Grouped counts with proportions

-- Q --

quantilegroup Bin a vector into quantile groups
quarter Extract the calendar quarter

-- R --

rangemerge Merge two tables by a range condition
rbindfill Row-bind tables, filling missing columns
recode Recode values by lookup (alias)
removeaccents Strip accents from text
removeall Remove text matching a pattern (alias)
removedrows Rows present in 'old' but not in 'new'
removeduplicates Remove duplicate rows, optionally by key
removetext Remove text matching a pattern
renamecols Rename columns
renamewith Rename columns with a function
reorderlevels Reorder factor levels
repairnames Repair column names
replaceall Recode values by lookup (alias)
replacecols Replace selected columns with new values
replacetext Replace a pattern with replacement text
replacevalues Recode values by lookup
replacewhere Replace values in selected columns where a condition holds
rescale Rescale a vector to a new range
reshape Core data manipulation operations
reverse Reverse row order
right Last 'n' characters
rollapply Rolling window apply
rollingmerge Rolling join two tables
rollmax Rolling maximum
rollmean Rolling mean
rollmedian Rolling median
rollmin Rolling minimum
rollprod Rolling product
rollsd Rolling standard deviation
rollsum Rolling sum
rollvar Rolling variance
rounddate Round a date to the nearest unit
rowall Row-wise 'all()' across columns
rowany Row-wise 'any()' across columns
rowapply Apply a function row-wise
rowcount Count matches of a value across columns, per row
rowfirst First non-missing value across columns, per row
rowlast Last non-missing value across columns, per row
rowmax Row-wise maximum across columns
rowmin Row-wise minimum across columns
rownames Row names
rownumber Row position

-- S --

sameschema Test whether two tables share the same column names
samplefrac Sample a fraction of rows without replacement
samplerows Sample 'n' rows without replacement
second Extract the second
semimerge Semi-join two tables
sentencecase Convert to sentence case
separate Split one column into several
setthreads Set basetable thread count for the session
similartext Nearest string match (alias)
split Split a table by groups
splitfirst First piece after splitting on a separator
splitlast Last piece after splitting on a separator
splittext Split text on a separator
squish Trim and collapse internal whitespace
stack Stack columns
standardize Standardize a vector to mean 0, SD 1
startswith Test whether strings start with a pattern
subset Core data manipulation operations
summaries Named grouped summaries
summarytab Table 1-style descriptive summary

-- T --

textdist Pairwise string distances
textlen Character length
titlecase Convert to title case
tolong Reshape columns into key/value rows
towide Reshape rows into columns
transform Core data manipulation operations
transliterate Transliterate text to ASCII
transpose Transpose a table
traverse Traverse a list of arguments
trim Trim leading and trailing whitespace
truncate Truncate text with an ellipsis
types Column types

-- U --

unionrows Set union of rows
uniquerows Unique rows, in memory or straight off a delimited file
uniques Count of distinct values per column
unite Combine several columns into one
unmatchedkeys Distinct keys of 'x' absent from 'y'
unstack Unstack a table
updatemerge Update rows from another table
upper Convert to upper case

-- W --

week Extract the week of year
weekday Extract the weekday name
winsorize Winsorize a vector at given quantiles
within Modify a table within an environment

-- Y --

year Extract the year
yearday Extract the day of year