Skip to content
This repository was archived by the owner on Feb 12, 2018. It is now read-only.

Commit 79603c0

Browse files
Update language-r.cson
1 parent 7d4def2 commit 79603c0

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

snippets/language-r.cson

+69
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,30 @@
4141
'Function':
4242
'prefix': 'fun'
4343
'body': 'function(${1:x}) ${3:{$0\\}}'
44+
'Generalized Linear Models':
45+
'prefix': 'glm'
46+
'body': 'glm(${1:formula}, ${2:family = {3:gaussian}}, ${4:data})'
47+
'Grep':
48+
'prefix': 'grep'
49+
'body': 'grep(${1:pattern}, ${2:x}, ${3:ignore.case = ${4:FALSE}}, ${5:perl = ${6:FALSE}})'
50+
'Grep':
51+
'prefix': 'grep'
52+
'body': 'grep(${1:pattern}, ${2:x}, ${3:ignore.case = ${4:FALSE}}, ${5:perl = ${6:FALSE}}, ${7:value = ${8:FALSE}}, ${9:fixed = ${10:TRUE}})'
53+
'Grep logical':
54+
'prefix': 'grepl'
55+
'body': 'grep(${1:pattern}, ${2:x}, ${3:ignore.case = ${4:FALSE}}, ${5:perl = ${6:FALSE}}, ${7:fixed = ${8:TRUE}})'
4456
'Ifelse':
4557
'prefix': 'ife'
4658
'body': 'ifelse(${1:test}, ${2:yes}, ${3:no})'
4759
'Install package':
4860
'prefix': 'ins'
4961
'body': 'install.packages(${1:pkgs}, ${2:lib}, ${3:repos = ${4:getOption("repos")}}, ${5:contriburl = ${6:contrib.url(repos, type)}})'
62+
'Kmeans':
63+
'prefix': 'km'
64+
'body': 'kmeans(${1:x}, ${2:centers}, ${3:iter.max = ${4:10}}, ${5:nstart = ${6:1}}, ${7:algorithm = ${8:c("Hartigan-Wong", "Lloyd", "Forgy","MacQueen")}}, ${9:trace = ${10:FALSE}})'
65+
'Kruskal-Wallis Rank Sum test':
66+
'prefix': 'kr'
67+
'body': 'kruskal.test(${1:formula}, ${2:data}, ${3:subset}, ${4:na.action}, ${5:\...})'
5068
'Lapply':
5169
'prefix': 'lap'
5270
'body': 'lapply(${1:X}, ${2:FUN}, ${3:\...})'
@@ -62,27 +80,63 @@
6280
'Load RData':
6381
'prefix': 'loa'
6482
'body': 'load(${1:file}, ${2:envir = ${3:parent.frame()}}, ${4:verbose = ${5:FALSE}})'
83+
'Linear regression':
84+
'prefix': 'lm'
85+
'body': 'lm(${1:formula}, ${2:data}, ${3:subset}, ${4:weights}, ${5:na.action})'
6586
'Matrix':
6687
'prefix': 'mat'
6788
'body': 'matrix(${1:data = ${2:NA}}, ${3:nrow = ${4:1}}, ${5:ncol = ${6:1}}, ${7:byrow = ${8:FALSE}}, ${9:dimnames = ${10:NULL}})'
6889
'Mean':
6990
'prefix': 'mea'
7091
'body': 'mean(${1:x}${2:, na.rm=${3:FALSE}})'
92+
'Merge':
93+
'prefix': 'mer'
94+
'body': 'merge(${1:x}, ${2:y}, ${3:by = ${4:intersect(names(x), names(y))}}, ${5:all = ${6:FALSE}})'
95+
'Names':
96+
'prefix': 'nam'
97+
'body': 'names(${1:x})'
98+
'Options':
99+
'prefix': 'opt'
100+
'body': 'options(${1:\...})'
101+
'Order':
102+
'prefix': 'ord'
103+
'body': 'order(${1:\...}, ${2:na.last = ${3:TRUE}}, ${4:decreasing = ${5:FALSE}})'
104+
'Outer':
105+
'prefix': 'out'
106+
'body': 'outer(${1:X}, ${2:Y}, ${3:FUN = ${4:"*"}}, ${5:\...})'
71107
'Paste':
72108
'prefix': 'pas'
73109
'body': 'paste(${1:\...}, ${2:sep = ${3:" "}}, ${3:collapse = ${4:NULL}})'
74110
'Paste0':
75111
'prefix': 'pas0'
76112
'body': 'paste(${1:\...}, ${2:collapse = ${3:NULL}})'
113+
'Plot':
114+
'prefix': 'print'
115+
'body': 'plot(${1:x}, ${2:y}, ${3:\...})'
116+
'Points':
117+
'prefix': 'poi'
118+
'body': 'points(${1:x}, ${2:y = ${3:NULL}}, ${4:type = ${5:"p"}}, ${6:\...})'
77119
'Polygonal Line':
78120
'prefix': 'lin'
79121
'body': 'lines(${1:x}${2:, color=${3:red}})'
122+
'Print':
123+
'prefix': 'pri'
124+
'body': 'print(${1:x}, ${2:\...})'
125+
'Quantile':
126+
'prefix': 'qua'
127+
'body': 'quantile(${1:x}, ${2:probs = ${3:seq(0, 1, 0.25)}}, ${4:na.rm = ${5:FALSE}}, ${6:names = ${7:TRUE}}, ${8:type = ${9:7}}, ${10:\...})'
80128
'Read From csv':
81129
'prefix': 'reac'
82130
'body': 'read.csv("${1:filename}"${2:, header = ${3:TRUE}, sep = "${4:\\,}", stringsAsFactors = ${5:FALSE}})'
83131
'Read From File':
84132
'prefix': 'reat'
85133
'body': 'read.table("${1:filename}"${2:, header = ${3:TRUE}, sep = "${4:\\t}", stringsAsFactors = ${5:FALSE}})'
134+
'Rep':
135+
'prefix': 'rep'
136+
'body': 'rep(${1:x}, ${2:\...})'
137+
'Sample':
138+
'prefix': 'sam'
139+
'body': 'sample(${1:x}, ${2:size}, ${3:replace = ${4:FALSE}}, ${5:prob = ${6:NULL}})'
86140
'Sequence (from,to,by)':
87141
'prefix': 'seq'
88142
'body': 'seq(${1:from}, ${2:to}, ${3:by})'
@@ -95,6 +149,21 @@
95149
'Standard deviation':
96150
'prefix': 'sd'
97151
'body': 'sd(${1:x}${2:, na.rm=${3:FALSE}})'
152+
'Table':
153+
'prefix': 'tab'
154+
'body': 'table(${1:\...})'
155+
'Tapply':
156+
'prefix': 'tap'
157+
'body': 'tapply(${1:X}, ${2:INDEX}, ${3:FUN = ${4:NULL}}, ${5:\...}, ${6:simplify = ${7:TRUE}})'
158+
'Unique':
159+
'prefix': 'uni'
160+
'body': 'unique(${1:x}, ${2:incomparables = ${3:FALSE}}, ${4:\...})'
161+
'Which':
162+
'prefix': 'whi'
163+
'body': 'which(${1:x}, ${2:arr.ind = ${3:FALSE}}, ${4:useNames = ${5:TRUE}})'
164+
'Write csv':
165+
'prefix': 'wric'
166+
'body': 'write.csv(${1:x}, ${2:file = ${3:""}}, ${4:append = ${5:FALSE}}, ${6:quote = ${7:TRUE}}, ${8:sep = ${9:" "}}'
98167
'File.choose':
99168
'prefix': 'fch'
100169
'body': '${1:file = }file.choose()${0:}'

0 commit comments

Comments
 (0)