Skip to content

Instantly share code, notes, and snippets.

View LeahBriscoe's full-sized avatar

Leah Briscoe LeahBriscoe

View GitHub Profile
@LeahBriscoe
LeahBriscoe / NodGenes.csv
Created September 19, 2016 06:05
Sample Data for "Make a Heatmap on R Studio"
Gene nodU nodS nodU/nodO nodD nodC2 nodB nodA nodI nodJ nodC1 nodH
Burkholderia 1 100 100 100 100 100 100 100 100 100 100 0
Burkholderia 2 99 98 98 94 90 94 98 98 96 87 0
Burkholderia 3 99 97 98 93 89 95 99 96 97 88 0
Burkholderia 4 98 94 96 99 79 94 98 96 94 89 0
Burkholderia 5 81 67 40 70 76 60 73 71 77 70 72
Burkholderia 6 80 66 39 69 76 60 73 70 77 70 69
Burkholderia 7 76 65 40 71 63 57 75 72 79 67 100
Burkholderia 8 76 69 40 72 63 56 75 74 79 66 94
Burkholderia 9 75 71 40 68 71 72 70 71 76 71 66
@LeahBriscoe
LeahBriscoe / HeatmapTutorial.R
Last active June 17, 2022 19:55
Tutorial on how to create a heat map on RStudio
install.packages("gplots")
installed.packages()
library(gplots) # perform each time you start up RStudio
getwd()
x <- read.csv("NodGenes.csv", check.names=FALSE)
y <- data.matrix(NodGenes)
y
?heatmap.2
heatmap.2(y, main = "Sample", trace= "none", margins = c(10,12), cexRow=0.5, Rowv=FALSE,Colv=FALSE, key)
?colorRampPalette
@LeahBriscoe
LeahBriscoe / PieChart
Created October 2, 2017 03:29
How to make a pie chart in R
values <- read.csv("~/Documents/TeachingResources/YouTube/PieChart/ToppingMoviePreference.csv",row.names=1, check.names=FALSE,header=TRUE)
values2 <- read.csv("~/Documents/TeachingResources/YouTube/PieChart/OD_Data.csv",row.names=1, header=TRUE)
require("RColorBrewer")
indices <- values[,1]!=0
pie(values[,1][indices],labels=row.names(values)[indices],col=brewer.pal(length(values[,1][indices]),'Spectral'))
legend("topleft",legend=row.names(values)[indices],fill=brewer.pal(length(values[,1][indices]),'Spectral'))
for(c in 1:ncol(values)){
indices <- values[,c]!=0