bin_to_raster | R Documentation |
Given a dataframe with 2 columns (bin number and variable), create a 2D matrix or raster FOR VISUALIZATION ONLY, NOT TO BE USED FOR STATS.
bin_to_raster(
df,
resolution = "4",
ext = c(xmn = -147, xmx = -41, ymn = 39, ymx = 86),
rast = TRUE,
max_bins = 5e+07
)
df |
Dataframe with 2 columns: first column="bin" and second column is the variable name (note: the dataframe does not have to be sorted in order of bin number). |
resolution |
String indicating spatial resolution, see ?gen_nrows for list of accepted strings. |
ext |
Named vector containing the boundaries of the resulting grid (xmn, xmx, ymn, ymx). |
rast |
TRUE/FALSE, should the resulting bin matrix be converted to raster? |
max_bins |
Maximum grid size (total number of pixels) that can be generated between the selected latitudes. This is to prevent overloading memory with the higher-resolution grids (e.g. 250m, 1km) |
Raster containing the variable data.
See https://oceancolor.gsfc.nasa.gov/docs/format/l3bins/ for more information on bin numbers.
# make a bathymetry raster for the Northwest Atlantic
bin_to_raster(df = get_bins(region="nwa",variables=c("bin","bathymetry")),
ext = c(lon_bounds$NWA, lat_bounds$NWA))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.