ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

R-snippets

by jvcasillas ST2/ST3

R snippets for Sublimetext

Labels snippets, R, statistics

Details

  • 2017.05.12.20.00.37
  • github.​com
  • github.​com
  • 5 months ago
  • 2 minutes ago
  • 4 years ago

Installs

  • Total 5K
  • Win 2K
  • OS X 2K
  • Linux 945
Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4
Windows 7 4 5 2 0 3 6 1 3 3 7 4 3 5 5 5 5 5 5 8 3 5 7 4 4 1 2 3 2 7 4 9 2 6 12 8 7 5 3 0 2 7 5 6 5 2
OS X 1 1 3 3 1 5 2 2 6 6 2 0 1 7 4 9 3 2 5 6 5 5 6 5 3 2 3 1 6 7 4 3 2 5 9 1 8 3 3 1 2 6 2 3 3 1
Linux 2 0 0 1 1 0 1 3 0 1 3 1 0 1 2 3 2 1 1 0 0 1 3 0 2 0 3 2 1 0 1 2 1 0 4 2 1 0 1 0 1 0 1 1 3 4

Readme

Source
raw.​githubusercontent.​com

R-snippets

This package includes a selection of R snippets for Sublimetext that I find useful when using R through SublimeREPL

Check out the project page at http://www.jvcasillas.com/code/projects/R-snippets

Just type the trigger and hit the tab key. For example…

lm

Expands to…

# load lme4 for mixed models
library(lme4)

# random intercept and random slope model
modelName <- lmer(DV ~ fixedFactor1 +* fixedFactor2 + (1 + randomSlope|randomInt), data=df)
summary(modelName)

Main triggers

  • “plot”: templates for plotting in base R
  • “edit”: options useful for data cleansing and saving
  • “desc”: descriptive statistics of data
  • “ttest”: distinct types of t-test
  • “aov”: distinct analysis of variance models
  • “lm”: linear and logistic regression
  • “lmem”: linear mixed effects models

Extras

  • “subset”: make subsets of a DF
  • “read”: read/load/install data/packages into R
  • “save”: save plots, dfs, tables, etc.
  • “tikz”: template for creating R plots in LaTeX

Note All snippets have the following scopes:

source.r, text.html.markdown.knitr, text.tex.latex, text.html.markdown.rmarkdown

To add

  • knitr
  • dplyr
  • coursera