corrade-nucleus-nucleons – Blame information for rev 24
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
20 | office | 1 | define("ace/snippets/r",["require","exports","module"], function(require, exports, module) { |
2 | "use strict"; |
||
3 | |||
4 | exports.snippetText = "snippet #!\n\ |
||
5 | #!/usr/bin/env Rscript\n\ |
||
6 | \n\ |
||
7 | # includes\n\ |
||
8 | snippet lib\n\ |
||
9 | library(${1:package})\n\ |
||
10 | snippet req\n\ |
||
11 | require(${1:package})\n\ |
||
12 | snippet source\n\ |
||
13 | source('${1:file}')\n\ |
||
14 | \n\ |
||
15 | # conditionals\n\ |
||
16 | snippet if\n\ |
||
17 | if (${1:condition}) {\n\ |
||
18 | ${2:code}\n\ |
||
19 | }\n\ |
||
20 | snippet el\n\ |
||
21 | else {\n\ |
||
22 | ${1:code}\n\ |
||
23 | }\n\ |
||
24 | snippet ei\n\ |
||
25 | else if (${1:condition}) {\n\ |
||
26 | ${2:code}\n\ |
||
27 | }\n\ |
||
28 | \n\ |
||
29 | # functions\n\ |
||
30 | snippet fun\n\ |
||
31 | ${1:name} = function (${2:variables}) {\n\ |
||
32 | ${3:code}\n\ |
||
33 | }\n\ |
||
34 | snippet ret\n\ |
||
35 | return(${1:code})\n\ |
||
36 | \n\ |
||
37 | # dataframes, lists, etc\n\ |
||
38 | snippet df\n\ |
||
39 | ${1:name}[${2:rows}, ${3:cols}]\n\ |
||
40 | snippet c\n\ |
||
41 | c(${1:items})\n\ |
||
42 | snippet li\n\ |
||
43 | list(${1:items})\n\ |
||
44 | snippet mat\n\ |
||
45 | matrix(${1:data}, nrow=${2:rows}, ncol=${3:cols})\n\ |
||
46 | \n\ |
||
47 | # apply functions\n\ |
||
48 | snippet apply\n\ |
||
49 | apply(${1:array}, ${2:margin}, ${3:function})\n\ |
||
50 | snippet lapply\n\ |
||
51 | lapply(${1:list}, ${2:function})\n\ |
||
52 | snippet sapply\n\ |
||
53 | sapply(${1:list}, ${2:function})\n\ |
||
54 | snippet vapply\n\ |
||
55 | vapply(${1:list}, ${2:function}, ${3:type})\n\ |
||
56 | snippet mapply\n\ |
||
57 | mapply(${1:function}, ${2:...})\n\ |
||
58 | snippet tapply\n\ |
||
59 | tapply(${1:vector}, ${2:index}, ${3:function})\n\ |
||
60 | snippet rapply\n\ |
||
61 | rapply(${1:list}, ${2:function})\n\ |
||
62 | \n\ |
||
63 | # plyr functions\n\ |
||
64 | snippet dd\n\ |
||
65 | ddply(${1:frame}, ${2:variables}, ${3:function})\n\ |
||
66 | snippet dl\n\ |
||
67 | dlply(${1:frame}, ${2:variables}, ${3:function})\n\ |
||
68 | snippet da\n\ |
||
69 | daply(${1:frame}, ${2:variables}, ${3:function})\n\ |
||
70 | snippet d_\n\ |
||
71 | d_ply(${1:frame}, ${2:variables}, ${3:function})\n\ |
||
72 | \n\ |
||
73 | snippet ad\n\ |
||
74 | adply(${1:array}, ${2:margin}, ${3:function})\n\ |
||
75 | snippet al\n\ |
||
76 | alply(${1:array}, ${2:margin}, ${3:function})\n\ |
||
77 | snippet aa\n\ |
||
78 | aaply(${1:array}, ${2:margin}, ${3:function})\n\ |
||
79 | snippet a_\n\ |
||
80 | a_ply(${1:array}, ${2:margin}, ${3:function})\n\ |
||
81 | \n\ |
||
82 | snippet ld\n\ |
||
83 | ldply(${1:list}, ${2:function})\n\ |
||
84 | snippet ll\n\ |
||
85 | llply(${1:list}, ${2:function})\n\ |
||
86 | snippet la\n\ |
||
87 | laply(${1:list}, ${2:function})\n\ |
||
88 | snippet l_\n\ |
||
89 | l_ply(${1:list}, ${2:function})\n\ |
||
90 | \n\ |
||
91 | snippet md\n\ |
||
92 | mdply(${1:matrix}, ${2:function})\n\ |
||
93 | snippet ml\n\ |
||
94 | mlply(${1:matrix}, ${2:function})\n\ |
||
95 | snippet ma\n\ |
||
96 | maply(${1:matrix}, ${2:function})\n\ |
||
97 | snippet m_\n\ |
||
98 | m_ply(${1:matrix}, ${2:function})\n\ |
||
99 | \n\ |
||
100 | # plot functions\n\ |
||
101 | snippet pl\n\ |
||
102 | plot(${1:x}, ${2:y})\n\ |
||
103 | snippet ggp\n\ |
||
104 | ggplot(${1:data}, aes(${2:aesthetics}))\n\ |
||
105 | snippet img\n\ |
||
106 | ${1:(jpeg,bmp,png,tiff)}(filename=\"${2:filename}\", width=${3}, height=${4}, unit=\"${5}\")\n\ |
||
107 | ${6:plot}\n\ |
||
108 | dev.off()\n\ |
||
109 | \n\ |
||
110 | # statistical test functions\n\ |
||
111 | snippet fis\n\ |
||
112 | fisher.test(${1:x}, ${2:y})\n\ |
||
113 | snippet chi\n\ |
||
114 | chisq.test(${1:x}, ${2:y})\n\ |
||
115 | snippet tt\n\ |
||
116 | t.test(${1:x}, ${2:y})\n\ |
||
117 | snippet wil\n\ |
||
118 | wilcox.test(${1:x}, ${2:y})\n\ |
||
119 | snippet cor\n\ |
||
120 | cor.test(${1:x}, ${2:y})\n\ |
||
121 | snippet fte\n\ |
||
122 | var.test(${1:x}, ${2:y})\n\ |
||
123 | snippet kvt \n\ |
||
124 | kv.test(${1:x}, ${2:y})\n\ |
||
125 | "; |
||
126 | exports.scope = "r"; |
||
127 | |||
128 | }); |