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
  • 7 months ago
  • 2 minutes ago
  • 4 years ago

Installs

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

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