# NOT RUN {
n=400;
synthesised.data<-data.frame(x=stats::runif(n),y=stats::runif(n),
year=stats::runif(n,0,sqrt(2)));
synthesised.data$dependent.variable<-unlist(lapply(1:nrow(synthesised.data),
function(X){
stats::dist(as.matrix(synthesised.data[c(1,X),1:2]),method =
"euclidean")<synthesised.data$year[X];
}))
result<-kernelPhil::kernel.smooth.in.space(dataset = synthesised.data);
ggplot2::ggplot(result,ggplot2::aes(x=x,y=y,colour=relative_density_TRUE))+
ggplot2::geom_point();
# }
Run the code above in your browser using DataLab