View source: R/geofield_methods.R
geofield_to_raster | R Documentation |
If you wish to work with the raster package, you can convert geofield objects to raster using this function.
geofield_to_raster(x)
raster_to_geofield(x)
x |
A geofield for |
A raster for geofield_to_raster
, or a geofield for
raster_to_geofield
.
if (
requireNamespace("Rgrib2", quietly = TRUE) &
requireNamespace("harpData", quietly = TRUE)
) {
geo <- read_grid(
system.file(
"grib/AROME_Arctic/2018/07/10/00/fc2018071000+000grib_fp",
package = "harpData"
),
"T2m"
)
meteogrid::iview(geo, legend = TRUE)
ras <- geofield_to_raster(geo)
if (require("raster")) {
plot(ras)
}
geo1 <- raster_to_geofield(ras)
meteogrid::iview(geo1, legend = TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.