Learn R Programming

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

statar (version 0.3.0)

Tools Inspired by Stata to Manipulate Tabular Data

Description

A set of tools to explore data.frames (summarize, tabulate, xtile, pctile, binscatter) and work with panel data (elapsed quarters/month, lead/lag, fill in rows of values, rolling functions).

Copy Link

Version

Install

install.packages('statar')

Monthly Downloads

718

Version

0.3.0

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Matthieu Gomez

Last Published

June 7th, 2015

Functions in statar (0.3.0)

compute_distance

Find minimum distance of each word to other groups
roll_lag

Apply rolling functions within time intervals
count_combinations

Find best string combinations that identify an id
keep_if

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

Create a new data.table by discarding certain columns
setna

fill NA in place based on non missing observations
discard_if

Create new data.table after discarding certain rows
stat_binmean

Plot the mean of y over the mean of x within bins of x.
setkeep

Keep only certain columns in place
tag

Creates a vector of zero except for one subscript
pctile

Weighted quantile of type 2 (similar to Stata _pctile)
xtile

Bin variable in groups (similar to Stata xtile)
fuzzy_join

Experimental fuzzy join function
is.panel

Check whether data.table is a panel data
join

Join two data frames together
sum_up

Gives summary statistics (corresponds to Stata command summarize)
pastem

String and expression interpolation
keep

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

A package for applied research
winsorize

Winsorize a numeric vector
find_duplicates

returns a data.frame with duplicated rows
fill_gap

Add rows corresponding to gaps in some variable
elapsed

Elapsed dates (monthly, quarterly)
group

Group multiple variable (similar to Stata group)
tempname

Create unique names within a list, a data.frame, or an environment
tlead-tlag

lead and lag with respect to a time variable
setdiscard

discard certain columns in place
tab

Returns cross tabulation