Skip to content

Instantly share code, notes, and snippets.

View oganm's full-sized avatar
🤦‍♂️

B. Ogan Mancarcı oganm

🤦‍♂️
View GitHub Profile
@oganm
oganm / plotting
Last active August 29, 2015 14:22
Double stdev plot
require(ggplot2)
require(stringr)
halo = read.table('Halo-Size.txt', header= T)
dry = read.table('Dry-Mass.txt', header =T)
# calculation of standard deviation
haloError = qnorm(0.975) * apply(halo, 2, sd)/sqrt(apply(halo, 2, length))
@oganm
oganm / jqfp.js
Last active April 15, 2018 15:03 — forked from srvanderplas/jqfp.js
Shiny user fingerprint (md5 hash of browser characteristics) and ip address demo. The .R files are in the working directory ("./"), the .js files must be placed in ./www/js/ to be accessible.
// Browser fingerprinting is a technique to "mark" anonymous users using JS
// (or other things). To build an "identity" of sorts the browser is queried
// for a list of its plugins, the screen size and several other things, then
// hashes them. The idea is that these bits of information produce an unique
// "fingerprint" of sorts; the more elaborate the list of data points is, the
// more unique this fingerprint becomes. And you wouldn't even need to set a
// cookie to recognize this user when she visits again.
//
// For more information on this topic consult
// [Ars Technica](http://arstechnica.com/tech-policy/news/2010/05/how-your-web-browser-rats-you-out-online.ars)
@oganm
oganm / Readme.md
Last active September 11, 2015 20:14 — forked from timelyportfolio/Readme.md
igraph in DiagrammeR

In response to this tweet

@riannone @abresler @timelyportfolio this popped into my head last week, how hard would it be to dump an igraph or graphNEL into diagrammeR?

— Tim Triche, Jr. (@timtriche) February 24, 2015
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

I made this little Gist. It illustrates one way to git an igraph into DiagrammeR using grViz. One way to use igraph with mermaid can be seen in this Gist R ( igraph + DiagrammeR + pipeR +htmltools ) + JS ( mermaid.js + d3.js + dagre-d3.js ).

Full attribute customization will probably not be possible with these two

@oganm
oganm / server.R
Last active October 19, 2018 22:00
shinyTree - fixing frozen inputs
#server.R
source('toTreeJSON.R')
library(shiny)
library(shinyTree)
library(magrittr)
createTree<- function(idTree){
switch(idTree,
"A" = list(A1 = list(A2 = "a", A3 = "b"), A4 = "c"),
"B" = list(B1 = list(B2 = "d"), B3 = "e", B4 = "f"))}
require(RSelenium)
remDr <- remoteDriver(remoteServerAddr = "localhost", port = 4444, browserName = "firefox")
remDr$open()
remDr$getStatus()
remDr$navigate("https://upassbc.translink.ca/")
---
title: "Quicky and dirty: side-by-side plot and table"
author: "Omar AlOmeir"
output:
github_document
---
```{r}
library(ggplot2)
suppressMessages(library(dplyr))
library(XLConnect)
library(magrittr)
library(dplyr)
# mouse rna seq data download Zeisel et al. download------
dir.create('data-raw/ZeiselMouse', showWarnings=FALSE)
download.file(url= 'http://storage.googleapis.com/linnarsson-lab-www-blobs/blobs/cortex/expression_mRNA_17-Aug-2014.txt',
destfile='data-raw/ZeiselMouse/mouseRNASeq_Zeisel 2015.txt')
download.file(url = 'http://science.sciencemag.org/highwire/filestream/628248/field_highwire_adjunct_files/1/aaa1934_TableS1.xlsx',
destfile = 'data-raw/ZeiselMouse/markerGenes.xlsx')
@oganm
oganm / explicit.R
Last active January 7, 2017 16:14
library(dplyr)
library(magrittr)
baseR = c('base','compiler','datasets','graphics','grDevices','grid','methods','parallel','splines','stats','stats4','tcltk','utils')
explicit = function(fileIn,fileOut,
ignore = baseR){
file = readLines(fileIn)
# if added to a shiny server, fixes the range of the slider to a predetermined length
oldSliderCoordinates = reactiveValues(range1 = data$date %>% max %>% subtract(sliderSize), # initial slider location 1
range2 = data$date %>% max) # initial slider location 2
observe({
range = input$dateRange[2] - input$dateRange[1]
range %<>% as('numeric')
if(range > sliderSize){
if(input$dateRange[2]!= oldSliderCoordinates$range2){