Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Dorman michaeldorman

View GitHub Profile
View loocv_lm.R
loocv = function(formula, data) {
pred = rep(NA, nrow(data))
for(i in 1:nrow(data)) {
fit = lm(formula = formula, data = data[-i, ])
pred[i] = predict(fit, data[i, ])
}
@michaeldorman
michaeldorman / IMS_Map.R
Last active Aug 29, 2015
R script to create and publish interpolated temperature map of Israel
View IMS_Map.R
###############################################################
# Code to publish interpolated temperature map #
# based on current observations from the #
# Israel Meteorological Service (IMS) website #
# Author: Michael Dorman #
###############################################################
library(XML)
library(httr)
library(plyr)