Skip to content

Instantly share code, notes, and snippets.

View chr1swallace's full-sized avatar

Chris Wallace chr1swallace

View GitHub Profile
## I don't know how much R you know already. Start at the beginning,
## use online R tutorials, the native help system, and books, and work
## through the steps below. I've tried to write enough that if you
## already know R you won't be bored, so if you don't already know R,
## please don't assume you *have* to complete these tasks!
## install packages - only need to do this first time
install.packages("devtools")
library(devtools)
install_github("chr1swallace/coloc") # has the finemap.abf function
@chr1swallace
chr1swallace / orcidcloud.R
Last active February 8, 2021 08:49
make a word cloud from an orcid id
## install packages using the following
## install.packages("devtools")
## library(devtools)
## install_github("ropensci/rorcid")
## install.packages(c("tm","wordcloud"))
## load libraries
library(rorcid)
library(wordcloud)
library(nnet)
nsnp <- 3
simdata <- function(n) {
X <- matrix(pmin(abs(rnorm(n*nsnp)),3),nrow=n)
p <- rbinom(n, 1, X[,1]/3)
q <- rbinom(n, 1, X[,nsnp]/3)
Y <- ifelse(p>0, 1, ifelse(q>0, 2, 0))