Mark Cherrie
28/09/17
I am interested in the relationship between population-level ultraviolet radiation (UVR) exposure and health, I applied the following method during my PhD:
Has the data you use or want to use grown in:
Even if the data you are working with has not changed, there is a greater need to document the steps taken in the collection and subsequent analysis so that the experiment can be replicated
End-to-end batch processing
Reproducible research
R has growth in popularity, from 73rd (2001) to 11th (2017) most popular programming language, according to the TIOBE rankings.
Lots of resources online, plus those dedicated to spatial analysis.
Very helpful online community that post regularly on the following sites: R-bloggers, Stackoverflow and Github.
xkcd.com
IMPORTANT
Large volumes of data often reside in a database or web server.
Databases: RPostgreSQL and mongolite.
Web server:
# Start the clock!
ptm <- proc.time()
# Insert command to be evaluated
# output to a text file
sink("timeout.txt")
# Stop the clock
proc.time() - ptm
# close connection to the text file
sink()
# Build the string where the data resides, the URL stem, then function variables to pinpoint a specific folder:
FTP <- paste0("ftp://apollo.eorc.jaxa.jp/
pub/JASMES/Global_05km/",
UVRtype, "/", temporal,"/",
substring(date,1,6), "/")
# Now we need to build string that pinpoints a specfic file and downloads it to /rawdata
searchFTP<-paste0(FTP, sat, "02SSH_A", date, "Av1_v811_7200_3601_",UVRtype,"__8b.gz")
download.file(searchFTP, destfile=paste0(getwd(), "/rawdata/", sub(FTP, "",searchFTP)))
@echo off "C:/PROGRA~1/R/R-33~1.2/bin/x64/R.exe"
CMD BATCH
C:/Users/mcherrie/batchprocessing/download.R
# download
recurrence <- "daily"
task_name <- "download"
bat_loc <- "C:\\Users\\mcherrie\\
batchprocessing\\download.bat"
time <- "23:59"
date<-"12/09/2017"
system(sprintf("schtasks /create /sd %s /sc %s /tn %s /tr \"%s\" /st %s", date,
recurrence, task_name, bat_loc, time))
## open tasks
system("control schedtasks")