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
#' fast_POSIXct | |
#' | |
#' Quickly convert local timestamps to a POSIXct vector | |
#' | |
#' @param x timestamps (YYYY-mm-dd HH:MM:SS) | |
#' @param tz local timezone | |
#' @return POSIXct vector | |
#' @export | |
fast_POSIXct <- function(x, tz) { | |
stopifnot(is.character(x)) |
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
#' (Left) join with a custom comparator | |
#' | |
#' @param left data.frame | |
#' @param right data.frame | |
#' @param by names of columns to join by | |
#' @param fun custom comparator (see examples) | |
#' | |
#' @examples | |
#' my_df <- data.frame(cyl = c(4, 4, 6, 8), vs = c(0, 1, NA, NA), foo = c("A", "B", "C", "D")) | |
#' my_fun <- function (e1, e2) (e1 == e2) | is.na(e2) |