Skip to content

Instantly share code, notes, and snippets.

@zkamvar
Last active July 12, 2016 13:04
Show Gist options
  • Save zkamvar/e0260aedb00e46a2952a to your computer and use it in GitHub Desktop.
Save zkamvar/e0260aedb00e46a2952a to your computer and use it in GitHub Desktop.
Custom snippets that I use for Rstudio
# test that skeleton
snippet tt
test_that("${1:stuffworks}", {
${2:skip_on_cran()}
})
# add a header line
snippet hl
#==============================================================================#
${0}
# skelton for internal documentation
snippet idoc
#==============================================================================#
# ${1:Description of internal function}
#
# Public functions utilizing this function:
# ## ${2:funk}
#
# Internal functions utilizing this function:
# ## ${3:ifunk}
#==============================================================================#
# skeleton for Rd code link
snippet clink
\code{\link{${0}}}
# My preference for setMethod
snippet sm
setMethod(
f = "${1:generic}",
signature(${2:varname} = "${3:class}"),
definition = function(${2:x, ...}) {
${0}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment