Learn R Programming

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

statar (version 0.4.0)

Tools Inspired by Stata to Manipulate Tabular Data

Description

A set of tools inspired by Stata to explore data.frames (summarize, tabulate, xtile, pctile, binscatter, elapsed quarters/month, lead/lag).

Copy Link

Version

Install

install.packages('statar')

Monthly Downloads

718

Version

0.4.0

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Matthieu Gomez

Last Published

December 30th, 2015

Functions in statar (0.4.0)

count

Count number of non missing observations
tempname

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

Check whether data.table is a panel data
stat_binmean

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

Creates a vector of zero except for one subscript
tab

Returns cross tabulation
fill_gap

Add rows corresponding to gaps in some variable
keep

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

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

Create new data.table after discarding certain rows
setdiscard

discard certain columns in place
setkeep

Keep only certain columns in place
statar

A package for applied research
tlead-tlag

lead and lag with respect to a time variable
group

Group multiple variable (similar to Stata group)
pctile

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

Join two data frames together
xtile

Bin variable in groups (similar to Stata xtile)
setna

fill NA in place based on non missing observations
winsorize

Winsorize a numeric vector
find_duplicates

returns a data.frame with duplicated rows
discard

Create a new data.table by discarding certain columns
sum_up

Gives summary statistics (corresponds to Stata command summarize)
elapsed

Elapsed dates (monthly, quarterly)