Created
December 21, 2017 16:52
-
-
Save jefferis/8e525008885aaa05713a4ce39906edf8 to your computer and use it in GitHub Desktop.
Summary of EM tracts connecting to the LH.
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
library(xtable) | |
#Sheet 6 from LHN Tract summary spreadsheet | |
data <- as.data.frame(read.csv("~/Desktop/lhntractdata.csv")) | |
#remove total row | |
data<- data[1:(nrow(data)-1),] | |
#cols_wanted for table & round | |
cols_wanted <- c(1,2,3,4,19,20) | |
table_data <- data[,cols_wanted] | |
table_data[,c(5,6)] <- round(table_data[,c(5,6)]) | |
#Make range column | |
rangecol <- c() | |
for (i in 1:nrow(table_data)) { | |
rangecol <- c(rangecol, paste0(table_data$Lowest.estimate...LHNs.[i], | |
" - ", table_data$Highest.Estimate....LHNs.[i])) | |
} | |
table_data <- cbind(table_data[,1:4],rangecol) | |
colnames(table_data) <- c("PNT", "EM Tract", "Est. Type", "Total Profiles", "LHN Est. Range") | |
#Latex Table Stored here | |
latex_table <- xtable(table_data) | |
align(latex_table) <- rep("r", 6) | |
latex_table | |
#--------------------------------- | |
#NB - Reqd. LaTeX boilerplate: | |
#\documentclass[11pt]{article} | |
#\begin{document} | |
#latex_table | |
#\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment