Skip to content

Instantly share code, notes, and snippets.

Petr Simecek simecek

Block or report user

Report or block simecek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@simecek
simecek / IMGC14_twitter_analysis.R
Last active Aug 29, 2015
Analysis of #IMGC14 tweets
View IMGC14_twitter_analysis.R
library(twitteR)
library(tm)
library(wordcloud)
library(RColorBrewer)
library(dplyr)
library(ggplot2)
# load tweets
download.file("ftp://ftp.jax.org/petrs/other/IMGC14.rds", destfile = "IMGC14_tweets.rds", mode="wb")
tweet <- readRDS("IMGC14_tweets.rds")
@simecek
simecek / iplot_example.R
Created Feb 11, 2015
Example of iplot usage
View iplot_example.R
library(testjs)
dataset <- readRDS("click_on_ggvis\\DO_liver_variability_sex.rds")
head(dataset)
out <- with(dataset, iplot(x=protein.Sex, y=mrna.Sex, indID=Associated.Gene.Name,
chartOpts=list(width=300, height=300)))
out
htmlwidgets::saveWidget(out, "iplot.html")
@simecek
simecek / start_course_RStudios.R
Last active Aug 29, 2015
For each participant, start RStudio with DOQTL preinstalled and send the email
View start_course_RStudios.R
library(analogsea) # to access Digital Oceal
library(sendmailR) # to send emails
library(parallel)
library(doParallel)# foreach parallelization
# Sys.setenv(DO_PAT = "*****")
# Set list of participants' emails
# email_list <- c("first_email@gmail.com", "second_email@gmail.com", ...)
@simecek
simecek / pim.R
Created Nov 23, 2011
Prague Half Marathon 2010
View pim.R
library(xlsReadWrite)
library(MASS)
### DATA DOWNLOAD
dir.name <- tempdir()
url2010 <- "http://www.praguemarathon.com/images/stories/articles/files/HM2010/HM2010_eng.xls"
file <- paste(dir.name, "2010.xls", sep="\\")
View get.dropbox.folder.r
get.dropbox.folder <- function() {
if (!require(RCurl)) stop ("You need to install RCurl package.")
if (Sys.info()["sysname"]!="Windows") stop("Currently, 'get.dropbox.folder' works for Windows only. Sorry.")
db.file <- paste(Sys.getenv('APPDATA'), '\\Dropbox\\host.db', sep='')
base64coded <- readLines(db.file, warn=FALSE)[2]
base64(base64coded, encode=FALSE)
}
@simecek
simecek / iplot_bug_example.R
Created Nov 10, 2015
Minimal example for iplot axis and title overplotting
View iplot_bug_example.R
library(shiny)
library(qtlcharts)
server <- function(input, output) {
output$interactivePlot <- iplot_render({
x <- rnorm(26) * ifelse(input$graphType == "higher values", 10, 1)
y <- rnorm(26) * ifelse(input$graphType == "higher values", 10, 1)
p1 <- iplot(x=x, y=y, indID = LETTERS,
chartOpts = list(title = input$graphType))
return(p1)
View s3.r
library(httr)
library(digest)
library(XML)
s3_request <- function(verb, bucket, path = "/", query = NULL,
content = NULL, date = NULL) {
list(
verb = verb,
bucket = bucket,
path = path,
@simecek
simecek / scatterplot.R
Last active Dec 31, 2015
Ggplot2 scatterplot
View scatterplot.R
# load dataset
dataset <- read.csv("http://dl.dropboxusercontent.com/u/232839/DO_liver_variability_sex.csv", as.is=TRUE)
head(dataset)
# make plot
library(ggplot2)
ggplot(aes(y=protein.Sex, x=mrna.Sex), data=dataset) +
geom_point(alpha=0.2, size=I(5)) +
geom_smooth(method=loess) +
ggtitle("Variability Explained by Sex") + theme_bw()
@simecek
simecek / click_on_ggvis.R
Created Feb 11, 2015
Interactive scatterplot
View click_on_ggvis.R
# Example of ggvis scatterplot
# on over - display MGI gene symbol
# on click - open browser with Ensembl page
library(ggvis)
# load dataset
dataset <- read.csv("http://dl.dropboxusercontent.com/u/232839/DO_liver_variability_sex.csv", as.is=TRUE)
head(dataset)
@simecek
simecek / Management+of+Twitter+Account.ipynb
Last active Mar 31, 2017
Managing Twitter Account With Tweepy
View Management+of+Twitter+Account.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.