- Copy SQLite.exe into the directory
- Copy database into the directory
- Copy source data file into the directory
NOTE Can also just reference paths if preferred
get.timing.data <- function(task, run_order){ | |
start.time <- Sys.time() | |
time <- system.time({CODE TO EXECUTE HERE}) | |
df <- data.frame(list(Task = task, | |
Run_Order = run_order, | |
Elapsed = time[3])) | |
return(df) | |
f$Sector <- sapply(f$Sector, | |
FUN = data.vacuum.adapt, | |
category = "Sector") |
# s$SCORE is a vector | |
freq <- cbind( | |
Freq = table(s$SCORE), | |
Cumm_Freq = cumsum(table(s$SCORE)), | |
Perc = round(prop.table(table(s$SCORE)) * 100, 4), | |
Cumm_Perc = round(cumsum(prop.table(table(s$SCORE))) * 100, 4) | |
) | |
freq <- as.data.frame(freq) |
d3.csv("aggregated_total.csv", function(d) { | |
var table = d3.select('#CSV_Table') | |
.append('table') | |
.attr("class", "center"); | |
var trh = table.append('tr'); | |
trh.append('td') | |
.text("Year") |
# Returns the standard deviation for a | |
# population (using N and not N-1 as | |
# denominator) | |
sdp <- function(x){ | |
# I adapted this from an answer I found | |
# on Stack Overflow | |
# Reference |
# Reference | |
https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man1/xsltproc.1.html">Apple document on xsltproc | |
# submit the line below to the Mac terminal | |
xsltproc index.xsl index.xml > output.txt |
if(!grepl("^[A-Z]{2}$", location)) | |
stop(sprintf("***%s*** is not a valid value for input parameter location. | |
Choose the two letter state abbreviation", location)) | |
# Replace | |
# Replaces anything with _#### with %i in a data frame | |
temp$TABLE_NAME <- sub("_[1,2][0-9][0-9][0-9]", "_%i", temp$TABLE_NAME) | |
# Look at records that fit a pattern |
/*Make Table Wide, Rows to Columns*/ | |
SELECT Cohort, State, | |
MAX(CASE WHEN GENDER = 'F' THEN N ELSE NULL END) AS N_F, | |
MAX(CASE WHEN GENDER = 'M' THEN N ELSE NULL END) AS N_M, | |
MAX(CASE WHEN GENDER = 'F' THEN SAT_Verbal ELSE NULL END) AS SAT_Verbal_F, | |
MAX(CASE WHEN GENDER = 'M' THEN SAT_Verbal ELSE NULL END) AS SAT_Verbal_M, | |
MAX(CASE WHEN GENDER = 'F' THEN SAT_Math ELSE NULL END) AS F_SAT_Math_F, | |
MAX(CASE WHEN GENDER = 'M' THEN SAT_Math ELSE NULL END) AS M_SAT_Math_M, | |
MAX(CASE WHEN GENDER = 'F' THEN SAT_Writing ELSE NULL END) AS SAT_Writing_F, |
'Macro to help mine data from an Excel workbook | |
'This reads through each worksheet in a workbook and outputs each value into | |
'a destination sheet. For each row it reads until it reaches a blank cell (across columns). | |
'For each sheet, it reads until it reaches a blank cell (down rows) | |
Sub MineDataFromWorkbook() | |
Dim wb As Workbook | |
'Replace NAME with workbook name (must be open in Excel) | |
Set wb = Application.Workbooks("NAME") |