# 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.with.margins(dataset =
synthesised.data,temporal.bandwidth = 0.2,measure.times =
seq(from=0.15,to=0.85,length.out=2),alpha=0.4,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())
# }
Run the code above in your browser using DataLab