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
  • 27 minutes ago
  • 7 years ago

Installs

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