Skip to content

Instantly share code, notes, and snippets.

@a-f-s-i-s
a-f-s-i-s / gist:59f25974fda1ba08fd39
Created June 18, 2015 07:42
rkernel hack code from ipython
"""A "native" IPython R kernel in 15 lines of code.
This isn't a real native R kernel, just a quick and dirty hack to get the
basics running in a few lines of code.
Put this into your startup directory for a profile named 'rkernel' or somesuch,
and upon startup, the kernel will imitate an R one by simply prepending `%%R`
to every cell.
"""
#BART (Bayesian Additive Regression Tree) Models
library(BayesTree)
trainingdata <- read.csv("Kaggle_training.csv")
testdata <- read.csv("sorted_test.csv")
soil_properties <- c("Ca", "P", "pH", "SOC", "Sand")
# CO2_bands <- 2656:2670
names(trainingdata)[2656:2670]