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
> in | |
Error: unexpected 'in' in "in" |
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
# Basic PCA example | |
# use www.createdatasol.com for | |
# an advanced user interface | |
#required packages for plotting | |
library(ggplot2) | |
library(ggrepel) | |
#load data | |
data<-read.csv('~/Sampledata.csv', |
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
#needed packages | |
library(andrews) | |
library(ggplot2) | |
#get some data here I use "mtcars" | |
data<-mtcars | |
fct<-as.factor(mtcars$cyl) # factor for intial grouping | |
#get andrews encoding (x and y coords) |
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 fast_tanimoto | |
#' @param mat matrix or data frame of numeric values | |
#' @param output 'matrix' (default) or 'edge list' (non-redundant and undirected) | |
#' @param progress TRUE, show progress | |
#' @imports reshape2 | |
fast_tanimoto<-function(mat,output='matrix',progress=TRUE){ | |
mat[is.na(mat)]<-0 | |
#scoring function | |
score<-function(x){sum(x==2)/sum(x>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
shinyServer(function(input, output, session) { | |
inputTextarea <- function(inputId, value="", nrows, ncols) { | |
tagList( | |
singleton(tags$head(tags$script(src = "textarea.js"))), | |
tags$textarea(id = inputId, | |
class = "inputtextarea", | |
rows = nrows, | |
cols = ncols, | |
as.character(value)) | |
) |
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
#demonstration of data summary tools | |
#enable necessary functions | |
source("http://pastebin.com/raw.php?i=JVyTrYRD") | |
#get demo data | |
library(RCurl) | |
url<-getURL("https://docs.google.com/spreadsheet/pub?key=0Ap1AEMfo-fh9dGFHRk81cVJaMTIxUjQzSlo2RS1RZXc&single=true&gid=0&output=csv",ssl.verifypeer = FALSE) | |
tmp.data<-read.csv(textConnection(url)) | |
#Prepare to generate data summaries and conduct statitcal tests |
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
shinyServer(function(input,output){ | |
mydat <- reactive(function() { | |
scale(rsnorm(input$obs, location = input$mean, scale =input$variance, | |
shape = input$skew),center=TRUE,scale=TRUE) | |
}) | |
ndat <- reactive(function() { | |
scale(rnorm(input$obs, mean = input$mean, sd =input$variance),center=TRUE, scale=TRUE) | |
}) | |
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
# Script to demonstrate distributions | |
library(VGAM) | |
library(eeptools) | |
library(shiny) | |
library(ggplot2) | |
shinyServer(function(input,output){ |
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
#Check pubmed article titles for a given year for a keyword (using partial matching). | |
library(XML) | |
library(stringr) | |
#get PubMed Ids for all journals for a given year | |
getPubMedIds<-function(year=2013, max=100){ | |
#max = maximum results to return | |
url<-paste0("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=",year,"[PDAT]&RetMax=",max) |
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
KTVPXOYAKDPRHY-SOOFDHNKSA-N AAAFZMYJJHWUPN-TXICZTDVSA-N main RP01256 | |
PQGCEDQWHSBAJP-TXICZTDVSA-N AAAFZMYJJHWUPN-TXICZTDVSA-N main RP10961 | |
YXJDFQJKERBOBM-TXICZTDVSA-N AAAFZMYJJHWUPN-TXICZTDVSA-N trans RP11184 | |
ZKHQWZAMYRWXGA-KQYNXXCUSA-N AAAFZMYJJHWUPN-TXICZTDVSA-N trans RP06423 | |
RWKJTIHNYSIIHW-MEBVTJQTSA-N AAJODOMQIUQTFG-XAICKWAHSA-N main RP12160 | |
RTPWRCREAVUAOI-CGJPUGKVSA-N AAKIIQMDPGWYFD-FFZYTXIOSA-N main RP11883 | |
XLYOFNOQVPJJNP-UHFFFAOYSA-N AAKIIQMDPGWYFD-FFZYTXIOSA-N leave RP09015 | |
XLYOFNOQVPJJNP-UHFFFAOYSA-N AAMCJNYIOAHDFN-BCCCWXECSA-N leave RP09666 | |
AUFGTPPARQZWDO-YUZLPWPTSA-N ABCOOORLYAOBOZ-KQYNXXCUSA-N trans RP08184 | |
BDAGIHXWWSANSR-UHFFFAOYSA-N ABCOOORLYAOBOZ-KQYNXXCUSA-N main RP10097 |