#' Shortcut to print names of a tibble/data frame to the console. Useful for pasting into spreadsheets.
#'
#' @param x Something with names.
#' @return The names of the input as a column.
#' @examples
#' namesToColumn(dystonia)
#' @export
namesToColumn = function(x) cat(names(x), sep = "\n")
#' Infix implementation of "contains"
#'
#' @param s Text.
#' @param pattern A grep pattern, usually a simple string.
#' @return TRUE if pattern is in s.
#' @examples
#' "tango" %contains% "tang"
#' @export
`%contains%` = function(s, pattern) grepl(pattern, s)
#' Infix implementation of "omits"
#'
#' @param s Text.
#' @param pattern A grep pattern, usually a simple string.
#' @return TRUE if pattern is NOT in s.
#' @examples
#' "tango" %omits% "gossamer"
#' @export
`%omits%` = function(s, pattern) !grepl(pattern, s)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.