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
# reference: | |
library('cowplot') | |
library('dplyr') | |
library('ggplot2') | |
library('lubridate') | |
data <- read.csv("https://opendata.ecdc.europa.eu/covid19/casedistribution/csv", na.strings = "", fileEncoding = "UTF-8-BOM") | |
swe = filter(data, countryterritoryCode == 'SWE') |
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
DT1 <- data.table(x = 1:5) | |
DT2 <- data.table(y = (1:5) + 0.01) | |
setkey(DT1, x) | |
setkey(DT2, y) | |
# the following does not maintain both columns | |
DT1[DT2, roll = 'nearest'] | |
# x | |
# 1: 1 | |
# 2: 2 |
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
suppressPackageStartupMessages({ | |
library('Biobase') | |
library('DESeq2') | |
library('sleuth') | |
}) | |
base_dir <- "~/Downloads/cuffdiff2_data_kallisto_results" | |
sample_id <- dir(file.path(base_dir,"results")) |
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
var GithubApi = require("github"); | |
// you can install the required module using `npm install github` | |
var user = "myUsername"; | |
var password = "myPassword"; | |
function filterRepos(item) { | |
var lowerName = item.full_name.toLowerCase(); | |
return item.owner.login !== 'berkeley-stat243' && |
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
catDf <- data.frame(meow = rnorm(100), purr = rpois(100, 3)) | |
aList <- list(aVector = 1:20, aDf = catDf, anotherList = list(1:200, 1:20)) | |
# annoying as hell, right? | |
head(aList) | |
#' Return the first or last part of a list | |
#' | |
#' Returns the first or last part of a list. Instead of returning the first | |
#' n entries as the standard head() does, it attempts to call head() |