library(mapdata) # do dodawania granic krajow
## Loading required package: maps
library(akima) # interpolacji
library(maptools) # do wczytywania shape;ow (shp)
## Loading required package: sp
## Checking rgeos availability: TRUE
data("akima")
akima$y <- akima$y+40
akima.li <- interp(akima$x, akima$y, akima$z) # najprostsza interpolacja
image(akima.li)
rozszerzona <- interp(akima$x, akima$y, akima$z,xo = seq(-5,30, by=0.1), yo = seq(35,65, by=0.1), extrap = T, linear = F)
contour(rozszerzona, add=T)
map('world', add = T, lty=3, lwd=1)

brejki<- seq(from=0, to=50, 5) # definiujesz przedzialy
image(rozszerzona, col=topo.colors(length(brejki)-1), main="tytuł mapy")
text(akima$x, akima$y, labels = akima$z)
points(akima$x, akima$y+0.5, pch=19)
pl <- readShapeSpatial("~/R/skryptydoR/gis/europa_bez_PL.shp")
plot(pl, add=T, col='#FF00FF90')

library(fields) # przesilona funkcja image.plot do rysowania mapy:
## Loading required package: spam
## Loading required package: grid
## Spam version 1.3-0 (2015-10-24) is loaded.
## Type 'help( Spam)' or 'demo( spam)' for a short introduction
## and overview of this package.
## Help for individual functions is also obtained by adding the
## suffix '.spam' to the function name, e.g. 'help( chol.spam)'.
##
## Attaching package: 'spam'
## The following objects are masked from 'package:base':
##
## backsolve, forwardsolve
image.plot(rozszerzona, col=topo.colors(length(brejki)-1), xlim=c(13,25), ylim=c(48,55), main="tytuł mapy")
pl <- readShapeSpatial("~/R/skryptydoR/gis/europa_bez_PL.shp")
plot(pl, add=T, col='gray')
points(17,52, cex=2, pch=19, col="white")
