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 <unordered_map> | |
| using namespace Rcpp; | |
| using namespace std; | |
| /* Trying to speed up matchSeqIds() | |
| Generate a C++ version called matchseq_cpp() | |
| Install inside matchSeqIds() - a wrapper around matchseq_cpp() | |
| */ |
library(magrittr)
library(tibble)
library(tidyr)
#>
#> Attaching package: 'tidyr'
#> The following object is masked from 'package:magrittr':
#>
#> extract
library(dplyr)
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
| reprex::reprex({ | |
| library(magrittr) | |
| library(tibble) | |
| suppressMessages(library(tidyr)) | |
| suppressMessages(library(dplyr)) | |
| # Option 1 | |
| # Proper nesting of cyl using group_by | |
| df1 <- mtcars %>% | |
| group_by(cyl) %>% |
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
| reprex::reprex({ | |
| library(magrittr) | |
| library(SomaObjects) | |
| library(tibble) | |
| library(feather) | |
| t_feather <- purrr::map_dbl(1:10, ~ { | |
| t <- Sys.time() | |
| write_feather(SurvData, "/tmp/surv.feather") | |
| as.numeric(Sys.time() - t) | |
| }) %>% mean() |
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
| #!/bin/sh | |
| echo | |
| echo "Thank you for contributing to the ..." | |
| echo " ___ ___ _____ __ ___ _____ _______ ___ " | |
| echo " (_-</ o \\/ \\ /o \\\\ |/ / -_) __(_-</ -_)" | |
| echo "/___/\\___/__Y_Y__\\/_/\\_\\\\__/\\__/_/ /___/\\__/ " | |
| # Read user input, assign stdin to keyboard |
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
| # General use suggested .Rprofile for env setup | |
| # Include additional functionality as required | |
| # 2019-01-24 | |
| # Stu Field, Bioinformatics, SomaLogic, Inc. | |
| # --------------------------------------------------- # | |
| # ------------------------- # | |
| ## session options | |
| # ------------------------- # | |
| options( |
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
| foo <- list(a = 1:5, b = letters, c = data.frame(set = 1:4)) | |
| key <- c(b = "super", a = "awesome", c = "wicked") | |
| nm <- . %>% purrr::map_chr(~ key[[.x]]) | |
| foo %>% purrr::set_names(nm) |
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
| # Set up custom debugging environment | |
| .customCommands <- new.env() | |
| assign("bug", structure("", class = "debugger_class"), envir = .customCommands) | |
| assign("print.debugger_class", function(debugger) { | |
| if ( !identical(as.character(getOption("error")), "rlang::entrace") ) { | |
| options(error = quote(rlang::entrace()), | |
| rlang__backtrace_on_error = "full") # or "collapse" | |
| message( | |
| crayon::green( | |
| cli::symbol$tick, |