Skip to content

Instantly share code, notes, and snippets.

@krlmlr
krlmlr / covr-per-file-analyze.R
Last active Mar 12, 2020
Mismatch between source and test file names
View covr-per-file-analyze.R
#' ---
#' title: Mismatch between source and test files in tibble
#' output:
#' html_notebook:
#' toc: true
#' code_folding: hide
#' ---
# For paged output
options(max.print = 1000)
View reprex.R
library(RSQLite)
conn <- dbConnect(SQLite())
dbExecute(conn, "
CREATE TABLE IF NOT EXISTS `sim` (
`time` TEXT,
`subject` INTEGER,
`encounter` INTEGER,
`location` INTEGER,
`temp` REAL,
@krlmlr
krlmlr / Rprofile-entrace
Last active Jan 7, 2021
Pretty stack traces in R
View Rprofile-entrace
# Add this to your .Rprofile
options(
error = quote(rlang::entrace()),
rlang__backtrace_on_error = "collapse" # or "branch" or "full"
)
@krlmlr
krlmlr / olson-abbrev.txt
Created Oct 25, 2017
Abbreviations for Olson names from Ubuntu system
View olson-abbrev.txt
Africa/Abidjan
Africa/Accra
Afr/Addis_Abab
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
View install.log
> devtools::install_github("tidyverse/dplyr")
Downloading GitHub repo tidyverse/dplyr@master
from URL https://api.github.com/repos/tidyverse/dplyr/zipball/master
Installing dplyr
Downloading GitHub repo hadley/rlang@ac7498c9
from URL https://api.github.com/repos/hadley/rlang/zipball/ac7498c9
Installing rlang
"C:/PROGRA~1/R/R-33~1.3/bin/x64/R" --no-site-file --no-environ --no-save
--no-restore --quiet CMD \
INSTALL \
View sqlite3-unsigned-64.patch
diff --git a/src/sqlite3/sqlite3.h b/src/sqlite3/sqlite3.h
index 37d1024..0f55423 100644
--- a/src/sqlite3/sqlite3.h
+++ b/src/sqlite3/sqlite3.h
@@ -248,8 +248,11 @@ typedef struct sqlite3 sqlite3;
** between 0 and +18446744073709551615 inclusive.
*/
#ifdef SQLITE_INT64_TYPE
+ #ifndef SQLITE_UINT64_TYPE
+ #define SQLITE_UINT64_TYPE unsigned SQLITE_INT64_TYPE
@krlmlr
krlmlr / huntr.R
Created Dec 23, 2016
Detect and manually fix missing join-by columns for dplyr
View huntr.R
withCallingHandlers(
remake::make(remake::list_targets()),
message = function(e) {
if (grepl("Joining, ", e$message)) {
by_clause <- gsub("Joining(.*)\n", "\\1", e$message)
clipr::write_clip(by_clause)
srcref <- testthat:::find_first_srcref(sys.calls()[-1:-15])
srcfile <- attr(srcref, "srcfile")$filename
rstudioapi::navigateToFile(srcfile, srcref[1], srcref[2])
stop("Insert by clause: ", by_clause)
View test-revdep.R
#library(devtools)
devtools::load_all()
#' # Testing revdep_check()
#'
#' Functions:
create_deps_tested <- function() {
deps <- list(
testee = character(),
View rowwise.Rmd
---
title: "Applying a function over rows of a data frame"
author: "Winston Chang"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
```
@krlmlr
krlmlr / gist:92007a8a8677fc56c87f
Created Mar 2, 2016
Offline GitHub issues, milestones, and labels, with wget
View gist:92007a8a8677fc56c87f
wget -np -k -e robots=off -r -l 1 https://github.com/krlmlr/tibble/milestones/ https://github.com/krlmlr/tibble/issues/ https://github.com/krlmlr/tibble/labels/