This gist consists of a makefile
and a script
that can automate the creation of PDFs from Slidify generated HTML slides. The script assumes that the makefile
and the script makepdf.js
are in the same directory as the Rmd
file. The makepdf.js
script uses casperjs, a very useful utility to automate tasks that require browser interaction. You may follow the installation instructions on the casperjs website, to make sure that you have all the dependencies correctly installed before trying this out.
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
# Some code to asses an SVM with a two-dimensional feature space: | |
# trend (price - simple moving average) and relative strength index. | |
# The code is an adaptation of the code found in the following linkedin post: | |
# "Trading the RSI using a Support Vector Machine" | |
# "https://www.linkedin.com/pulse/article/20141103165037-172934333-trading-the-rsi-using-a-support-vector-machine" | |
# Settings | |
sma.window = 50 # Number of observations in simple moving average. | |
rsi.window = 3 # Number of observation in relative strength index (RSI) |
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
#Write geojson | |
#==== | |
#Load libraries | |
library(rgdal) | |
#dataMap is a dataframe with coordinates on cols 11 (LATITUDE) and 12 (LONGITUDE) | |
#Transfor coordinates to numeric | |
dataMap$LATITUDE <- as.numeric(dataMap$LATITUDE) | |
dataMap$LONGITUDE <- as.numeric(dataMap$LONGITUDE) |
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
## Example procedure for working with data (attributes) inside SpatialPolygonsDataFrame objects | |
# Load my favorite libraries for that sort of work | |
library(data.table) | |
library(rgdal) | |
# Load 2 shapefiles that, say, we want to merge. | |
# Note that you can read pretty much any spatial format using readOGR(). | |
tza.l2 <- readOGR("./analysis/TZA-AC-07/maps", "tza-ac-07_L2") | |
tza.l1 <- readOGR("./analysis/TZA-AC-07/maps", "tza-ac-07_L1") |