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
  • 2 years ago
  • 2 hours ago
  • 5 years ago

Installs

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

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