df2brick | R Documentation |
Converts a XYZ-layer data frame to a raster brick.
df2brick(df, x_col, y_col, z_col, layer_col)
df |
A dataframe with XYZ info for many layers |
x_col |
Name of the column with the x info |
y_col |
Name of the column with the y info |
z_col |
Name of the column with the z info |
layer_col |
Name of the column with the layer info |
A raster brick
nlayers <- 10
df <- expand.grid(layer=1:nlayers, x=1:10, y=1:10) %>%
arrange(layer) %>%
mutate(z=runif(n=n()))
df_brick <- df2brick(df=df, x_col="x", y_col="y", z_col="z", layer_col="layer")
raster::plot(df_brick)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.