This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Pattern-matching tryCatch | |
#' | |
#' Catch only specific types of errors at the appropriate level. | |
#' Supports nested use, where errors not matched by inner calls will | |
#' be passed to outer calls that may (or may not) catch them | |
#' separately. | |
#' | |
#' @details | |
#' | |
#' Exception handling with a little finer control over *where* a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' 'Reduce' with arbitrary number of arguments | |
#' | |
#' Applies a function to the corresponding elements of given vectors, | |
#' in a reductionist way. (This is *not* related to the [Apache Hadoop | |
#' MapReduce](https://hadoop.apache.org/) project ... while this may | |
#' suggest the name 'MapReduce' is a poor choice for this function, it | |
#' is a logical combination of R's [Map()] and [Reduce()] functions.) | |
#' | |
#' @details | |
#' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# changing a single repo with subdirs like this: | |
# | |
# origrepo | |
# +-- subdir1 | |
# +-- subdir2 | |
# | |
# into a different/new repo with rearranged dirs (and discarded files), | |
# editing the full history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Wrap a frame across multiple columns | |
#' | |
#' https://stackoverflow.com/a/52669757/3358272 | |
#' @param x `data.frame` | |
#' @param nr,nc `integer`; specify only one of these, the number of | |
#' rows or columns to be fixed | |
#' @param rownames if `NULL` (default), row names (if found) are | |
#' discarded; if `character`, then a column is added (on the left of | |
#' `x`) with this as its title | |
#' @param byrow `logical`; if `FALSE`, the first column will match the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Mid-pipe assertions | |
#' | |
#' Test assertions mid-pipe. Each assertion is executed individually | |
#' on each group (if present) of the piped data. Any failures indicate | |
#' the group that caused the fail, terminating on the first failure. | |
#' | |
#' If `.debug`, then the interpreter enters the `browser()`, allowing | |
#' you to look at the specific data, stored as `x` (just the grouped | |
#' data if `is.grouped_df(.x)`, all data otherwise). If the data is | |
#' changed, then the altered data will be sent forward in the pipeline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; my-align.el | |
;; Copyright (c) 2017 Bill Evans (r2evans) | |
;; | |
;; Author: Bill Evans | |
;; Created: 2017 Aug 03 | |
;; Keywords: code align programming | |
;;; Commentary: | |
;; Simple wrapper wround 'align-regexp' with sane defaults. | |
;; Based on code first seen here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Sequential file naming | |
#' | |
#' (https://stackoverflow.com/a/44868545/3358272) | |
#' | |
#' @param ptn string that includes a [base::sprintf()] format string for an | |
#' integer, either `%d` or `%03d`; for example, `"filename-%03d.pdf"` | |
#' @param full.names logical, passed to [base::files()] | |
#' @return character, representing a filename that did not exist the | |
#' moment the function was called; NB: there is a potential | |
#' race-condition here |
NewerOlder