Tidy up some parts of r.snippets

This commit is contained in:
Josh Davis 2014-03-30 01:04:00 -05:00
parent 55887f0db4
commit bd8ef3d110

View File

@ -36,7 +36,7 @@ endsnippet
# functions # functions
snippet fun "Function definition" snippet fun "Function definition"
${1:name} = function (${2:variables}) { ${1:name} <- function (${2:variables}) {
${0} ${0}
} }
endsnippet endsnippet
@ -59,7 +59,7 @@ list(${0:items})
endsnippet endsnippet
snippet mat "Matrix function" snippet mat "Matrix function"
matrix(${1:data}, nrow=${2:rows}, ncol=${0:cols}) matrix(${1:data}, nrow = ${2:rows}, ncol = ${0:cols})
endsnippet endsnippet
# apply functions # apply functions
@ -88,8 +88,8 @@ tapply(${1:vector}, ${2:index}, ${0:function})
endsnippet endsnippet
snippet rapply "rapply function" snippet rapply "rapply function"
rapply(${1:list}, ${0:function})
endsnippet endsnippet
rapply(${1:list}, ${0:function})
# plot functions # plot functions
snippet pl "Plot function" snippet pl "Plot function"
@ -101,7 +101,7 @@ ggplot(${1:data}, aes(${0:aesthetics}))
endsnippet endsnippet
snippet img "Output an image" snippet img "Output an image"
${1:(jpeg,bmp,png,tiff)}(filename="${2:filename}", width=${3}, height=${4}, unit="${5}") ${1:(jpeg,bmp,png,tiff)}(filename = "${2:filename}", width = ${3}, height = ${4}, unit = "${5}")
${0:plot} ${0:plot}
dev.off() dev.off()
endsnippet endsnippet