This file contains hidden or 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
# ggplot2 + scam monotonic smoother | |
# alpha works on the line when se = FALSE | |
# Depends: ggplot2, scam | |
StatSmoothMonotonic <- ggplot2::ggproto( | |
"StatSmoothMonotonic", ggplot2::Stat, | |
required_aes = c("x", "y"), | |
compute_group = function(data, scales, | |
se = TRUE, level = 0.95, n = 100, | |
k = 10, dir = c("increasing","decreasing"), |
This file contains hidden or 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
#include <Rcpp.h> | |
#include "edlib_external.h" | |
// [[Rcpp::depends(edlibR)]] | |
using namespace Rcpp; | |
// [[Rcpp::export]] | |
List edlib_test_basic() { | |
// simple example | |
std::string query = "GATTACA"; |
This file contains hidden or 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
library(sakura) | |
library(microbenchmark) | |
library(dplyr) | |
class_names <- sapply(1:48, function(i) { | |
paste0("class", i) | |
}) | |
sfuncs <- lapply(1:48, function(i) { | |
function(x) as.raw(i) |
This file contains hidden or 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
library(ggplot2) | |
library(dplyr) | |
library(qs2) | |
LEN <- 2^30 / 8 | |
set.seed(314156); data <- rnorm(LEN) + seq(1,LEN,1) # 1 GB | |
qs_send <- 4.40 # seconds | |
serialize_send <- 1.94 | |
qs_size <- length(qs_serialize(data, compress_level = 1, nthreads=4)) # 852 MB | |
serialize_size <- length(serialize(data, connection = NULL)) # 1 GB |
This file contains hidden or 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
total_time <- Sys.time() | |
suppressMessages(library(Rcpp)) | |
suppressMessages(library(dplyr)) | |
suppressMessages(library(data.table)) | |
suppressMessages(library(qs)) | |
suppressMessages(library(stringfish)) | |
options(warn = 1) | |
do_gc <- function() { |
This file contains hidden or 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
library(stringi) # devtools::install_github("traversc/stringi") | |
library(tictoc) | |
enwik8 <- readLines("~/Downloads/enwik8", warn = F) | |
search <- c("Wikipedia", "^.") | |
replace <- c("Encyclopedia", "") | |
tic("WITHOUT alt rep") | |
stri_use_alt_rep(FALSE); result <- stri_replace_all_regex(enwik8, search, replace, vectorize_all = F) | |
toc() |
This file contains hidden or 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
#include <atomic> | |
#include <thread> | |
#include <Rcpp.h> | |
#include <R_ext/Print.h> | |
using namespace Rcpp; | |
class simple_progress { | |
private: | |
const size_t max; | |
std::atomic<size_t> counter; |
This file contains hidden or 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
library(qs) | |
library(data.table) | |
library(dplyr) | |
library(ggplot2) | |
library(fst) | |
library(patchwork) | |
library(ggformula) | |
library(hrbrthemes) | |
library(Rcpp) | |
library(trqwe) |
This file contains hidden or 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
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <io.h> | |
#include <fcntl.h> | |
#include <string.h> | |
#include <array> | |
#include <Rcpp.h> | |
using namespace Rcpp; | |
// [[Rcpp::plugins(cpp11)]] |
This file contains hidden or 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
#include <cerrno> | |
#include <fcntl.h> | |
#include <cstdio> | |
#include <unistd.h> | |
#include <string.h> | |
#include <array> | |
#include <Rcpp.h> | |
using namespace Rcpp; | |
// [[Rcpp::plugins(cpp11)]] |
NewerOlder