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

R-snippets

by jvcasillas ALL

R snippets for Sublimetext

Labels snippets, R, statistics

Details

  • 2017.05.12.20.00.37
  • github.​com
  • github.​com
  • 3 years ago
  • 3 hours ago
  • 6 years ago

Installs

  • Total 10K
  • Win 5K
  • Mac 4K
  • Linux 2K
Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 29 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24
Windows 0 1 2 2 2 1 2 4 2 2 3 1 1 4 1 3 4 2 1 2 4 2 1 5 2 0 3 0 2 1 7 5 1 0 0 4 3 2 3 1 1 3 2 4 2 2
Mac 1 0 1 4 0 1 3 2 0 4 0 3 1 2 1 0 1 1 0 0 0 1 2 0 2 1 0 1 0 0 0 1 1 0 0 3 1 1 1 1 0 2 3 1 0 2
Linux 0 1 5 2 1 0 0 0 1 1 0 1 1 3 0 0 1 1 1 2 0 1 1 0 1 0 1 0 2 1 0 3 0 0 0 1 0 0 1 0 0 1 0 0 1 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