Learn R Programming

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

statar (version 0.1.2)

Tools Inspired by Stata to Clean, Explore and Join Datasets

Description

statar makes it easier to work with tabular datasets. The package includes a set of functions to clean and summarize variables, 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). The package also includes functions to emulate Stata and Julia string and expression interpolation. statar is based on the data.table package and is inspired by Stata.

Copy Link

Version

Install

install.packages('statar')

Monthly Downloads

580

Version

0.1.2

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Matthieu Gomez

Last Published

November 1st, 2014

Functions in statar (0.1.2)

join

Join two data.tables together
roll_lag

Apply rollling functions with respect to a time variable
winsorize

Winsorize a numeric vector
setna

fill NA in place based on non missing observations
setmutate_each

Version of mutate_each that (i) transforms data.table in place (ii) allows by, i condition (iii) when only when fun, creates new variables - except when replace = TRUE
duplicates

returns duplicated rows
pastem

String and expression interpolation
floor_date

floor_date Round date-times down.
graph

Experimental function to graph a dataset
setmutate

Version of mutate that (i) transforms data.table in place (ii) allows by, i condition
tempname

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

Creates a vector of zero except for one subscript
elapsed

Elapsed dates (monthly, quarterly)
fill_gap

Add rows corresponding to gaps in some variable
setkeep

Keep only certain columns in place
statar

A package for applied research
sample_mode

Statistical mode
sum_up

Gives summary statistics (corresponds to Stata command summarize)
setdrop

Drop certain columns in place
lead-lag

lead and lag with respect to a time variable
demean

Demean a vector
bin

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