View source: R/matrix_processing.R
akima_bilinear | R Documentation |
Interpolated on a grid using akima interpolation
akima_bilinear(df, out_dim)
df |
data.frame containing gridded x, y locations and z values |
out_dim |
vector containing |
The data.frame df must contain columns for x, y, and z. The x and y values must be on a grid.
Interpolation is done using akima::bilinear
library(ggplot2)
library(ggp)
df <- expand.grid(x=1:5,y=1:5)
df$z <- df$x^2 + df$y^2
df_out <- akima_bilinear(df, c(100,100))
ggplot(df) + geom_raster(aes(x,y,fill=z)) + coord_equal()
ggplot(df_out) + geom_raster(aes(x,y,fill=z)) + coord_equal()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.