Learn R Programming

⚠️There's a newer version (0.7.6) of this package.Take me there.

statar (version 0.2)

Tools Inspired by Stata to Manipulate Tabular Data

Description

Tools inspired by Stata for tabular datasets. It includes a set of functions to summarize and tabulate datasets, to join datasets using an SQL-syntax, to manipulate datasets with a panel structure (elapsed dates, lead/lag, rolling functions, fill in missing values based on previous dates, add rows for missing dates).

Copy Link

Version

Install

install.packages('statar')

Monthly Downloads

718

Version

0.2

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Matthieu Gomez

Last Published

June 3rd, 2015

Functions in statar (0.2)

demean

Demean a vector
setkeep

Keep only certain columns in place
elapsed

Elapsed dates (monthly, quarterly)
pastem

String and expression interpolation
discard_if

Create new data.table after discarding certain rows
compute_distance

Find minimum distance of each word to other groups
xtile

Bin a numeric vector and return integer codes for the binning (corresponds to Stata command xtile)
fill_gap

Add rows corresponding to gaps in some variable
vars

select variables in a data.frame
tempname

Create unique names within a list, a data.frame, or an environment
join

Join two data.tables together
keep

Create new data.table by keeping only certain columns (equivalent to dplyr::select)
count_combinations

Find best string combinations that identify an id
tab

Returns cross tabulation
discard

Create a new data.table by discarding certain columns
fuzzy_join

Fuzzy join two data.tables together
find_duplicates

returns a data.frame with duplicated rows
roll_lag

Apply rolling functions within time intervals
graph

Experimental function to graph a dataset
keep_if

Create new data.table by keeping only certain rows(equivalent to dplyr::filter)
winsorize

Winsorize a numeric vector
floor_date

floor_date Round date-times down.
sum_up

Gives summary statistics (corresponds to Stata command summarize)
setdiscard

discard certain columns in place
is.panel

Check whether data.table is a panel data
tlead-tlag

lead and lag with respect to a time variable
setna

fill NA in place based on non missing observations
tag

Creates a vector of zero except for one subscript
statar

A package for applied research