From 4fff4b48e095a455604c96a682cff9bc99f4f861 Mon Sep 17 00:00:00 2001 From: Nan Cloudio Jiang Date: Fri, 21 Dec 2012 20:04:19 -0500 Subject: [PATCH] R.snippets. Add snippets for frequently used plot and statistical test functions --- snippets/r.snippets | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/snippets/r.snippets b/snippets/r.snippets index 909e70d..71186e3 100644 --- a/snippets/r.snippets +++ b/snippets/r.snippets @@ -93,3 +93,29 @@ snippet ma maply(${1:matrix}, ${2:function}) snippet m_ m_ply(${1:matrix}, ${2:function}) + +# plot functions +snippet pl + plot(${1:x}, ${2:y}) +snippet ggp + ggplot(${1:data}, aes(${2:aesthetics})) +snippet img + ${1:(jpeg,bmp,png,tiff)}(filename="${2:filename}", width=${3}, height=${4}, unit="${5}") + ${6:plot} + dev.off() + +# statistical test functions +snippet fis + fisher.test(${1:x}, ${2:y}) +snippet chi + chisq.test(${1:x}, ${2:y}) +snippet tt + t.test(${1:x}, ${2:y}) +snippet wil + wilcox.test(${1:x}, ${2:y}) +snippet cor + cor.test(${1:x}, ${2:y}) +snippet fte + var.test(${1:x}, ${2:y}) +snippet kvt + kv.test(${1:x}, ${2:y})