This file contains 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(GenomicRanges) | |
library(plyranges) | |
## Create a GRanges object | |
gr <- GRanges(seqnames = "chr1", | |
strand = c("+", "-"), | |
ranges = IRanges(start = c(102012,520211), | |
end=c(120303, 526211)), | |
gene_id = c(1001,2151), | |
score = c(10, 25)) |
This file contains 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(jpeg) # or png, depending on your image (replace readJPEG with readPNG) | |
y <- readJPEG("rafa.jpeg") # You can get this off Google if you want to test it. | |
jpeg("channels1to3.jpeg", width = 1200, height = 800) | |
par(mfrow=c(2,3)) | |
image(y[,,1], main = "Channel 1") | |
image(y[,,2], main = "Channel 2") | |
image(y[,,3], main = "Channel 3") | |
image(y[,,1], main = "Channel 1", col = rgb(seq(0, 1, by = 0.05), 0, 0)) | |
image(y[,,2], main = "Channel 2", col = rgb(0, seq(0, 1, by = 0.05), 0)) |
This file contains 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(rvest) | |
library(stringr) | |
urlpage <- "http://www.amstat.org/ASA/Your-Career/Awards-and-Scholarships.aspx" | |
awards <- read_html(urlpage) | |
awardTitles <- awards %>% | |
html_nodes("#ctl00_TemplateBody_WebPartManager1_gwpciNewContentHtml_ciNewContentHtml_Panel_NewContentHtml a") %>% html_text() | |
awardURLs <- awards %>% |
This file contains 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(cowplot) | |
library(ggplot2) | |
library(PASWR) | |
data(Cows) # already in a "tidy" format | |
box.cow <- ggplot(Cows, aes(x = breed, y = butterfat, fill = age)) + | |
geom_boxplot() + labs(title = "Default cowplot theme") | |
save_plot("boxCow.jpeg", box.cow) |
This file contains 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: "UF Department of Statistics Job Postings" | |
author: "Stephanie Hicks" | |
date: "23 Feb 2015" | |
output: html_document | |
keep_md: TRUE | |
--- | |
## Purpose |
This file contains 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
# Load library | |
library(ggplot2) | |
# ToT = Trick-or-Treators | |
tEnd = 3*60*60 # 3 hours (in seconds) | |
lambdaMin = 1 # Define the rate as 1 ToT per minute | |
lambdaSec = lambdaMin/60 # converted rate in ToT per second | |
# Randomly inter-arrival times between ToT using an exponential distribution | |
t = 0; k = 0 |
This file contains 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
clean.tweets <- function(some_txt) | |
{ | |
some_txt = gsub("&", "", some_txt) | |
some_txt = gsub("(RT|via)((?:\\b\\W*@\\w+)+)", "", some_txt) | |
some_txt = gsub("@\\w+", "", some_txt) | |
some_txt = gsub("[[:punct:]]", "", some_txt) | |
some_txt = gsub("[[:digit:]]", "", some_txt) | |
some_txt = gsub("http\\w+", "", some_txt) | |
some_txt = gsub("[ \t]{2,}", "", some_txt) | |
some_txt = gsub("^\\s+|\\s+$", "", some_txt) |
This file contains 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
<!-- mathjax javascript --> | |
<script type="text/x-mathjax-config"> | |
MathJax.Hub.Config({ | |
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]} | |
}); | |
</script> | |
<script type="text/javascript" src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> | |
</script> |