# NOT RUN {
n=200;
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.and.time(dataset =
synthesised.data,temporal.bandwidth = 0.25,measure.times =
seq(from=-0.05,to=1.15,length.out=4),alpha = 0.15,margin = 0.2);
gridExtra::grid.arrange(ggplot2::ggplot(result$results[[1]],
ggplot2::aes(x=x,y=y,colour=relative_density_TRUE))+
ggplot2::geom_point(),ggplot2::ggplot(result$results[[2]],
ggplot2::aes(x=x,y=y,colour=relative_density_TRUE))+
ggplot2::geom_point(),ggplot2::ggplot(result$results[[3]],
ggplot2::aes(x=x,y=y,colour=relative_density_TRUE))+
ggplot2::geom_point(),ggplot2::ggplot(result$results[[4]],
ggplot2::aes(x=x,y=y,colour=relative_density_TRUE))+
ggplot2::geom_point());
# }
Run the code above in your browser using DataLab