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
utils::writeClipboard( | |
paste0( | |
"c(\n", | |
paste0( | |
sQuote(colnames(z), | |
q = "ASCII"), | |
sep = ",", | |
collapse = "\n"), |
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
# requires openssl package | |
hash_files <- function(paths){ | |
num_paths <- length(paths) | |
pb <- txtProgressBar(max=num_paths) | |
lapply(seq_along(paths), function(x){ | |
setTxtProgressBar(pb, x) | |
flush.console() | |
openssl::sha1(file(paths[[x]])) | |
}) |
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
--- | |
title: "Programming IDBac" | |
author: "Chase Clark" | |
date: "1/31/2020" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(eval = FALSE, include = TRUE) | |
``` |
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
#' Check if a pool object | |
#' | |
#' @param pool variable to check | |
.checkPool <- function(pool){ | |
val <- all(inherits(pool, "Pool"), | |
inherits(pool, "R6")) | |
if (isFALSE(val)) { |
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(data.table) | |
library(geofacet) | |
library(grid) | |
library(gganimate) | |
# Accessed 2020-03-24 at 9pm CST | |
confirmed <- data.table::fread("http://covidtracking.com/api/states/daily.csv") | |
confirmed$date <- as.Date(as.character(confirmed$date), "%Y%m%d") | |
confirmed <- confirmed[confirmed$date != "2020-03-24", ] |
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
N=5 | |
for( i in 1:(N-1) ){ | |
for( j in (i+1):N ){ | |
print(paste(i,j)) | |
} | |
} |
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
protein | average | |
---|---|---|
RL29 [M+2H]2+ | 3637.8 | |
RS32 [M+H]+ | 5096.8 | |
RS34 [M+H]+ | 5381.4 | |
RS33meth [M+H]+ | 6255.4 | |
RL29 [M+H]+ | 7274.5 | |
RS19 [M+H]+ | 10300.1 | |
RNAse A [M+H]+ | 13683.2 | |
Myoglobin [M+H]+ | 16952.3 |
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
# install.packages("dendexted") | |
lca_height <- function(dend, | |
input_a, | |
input_b) { | |
subtrees <- dendextend::partition_leaves(dend) | |
find_ancestors <- function(input_labels) { | |
which(sapply(subtrees, function(x) input_labels %in% x)) |
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(data.table) | |
library(reshape2) | |
library(ggplot2) | |
a <- "https://covidtracking.com/api/v1/states/IL/daily.csv" | |
a <- data.table::fread(a) | |
a$date <- as.Date(as.character(a$date), "%Y%m%d") |
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(data.table) | |
library(geofacet) | |
raw_data <- data.table::fread("http://covidtracking.com/api/states/daily.csv") | |
raw_data$date <- as.Date(as.character(raw_data$date), "%Y%m%d") | |
raw_data <- raw_data[date > "2020-03-15", ] |