Converts a data frame with longitude and latitude information to a a grid

df_to_grid(df, varnam, lonnam = "lon", latnam = "lat")

Arguments

df

A data frame. Must have columns named 'lon' and 'lat' with values shared with longitude and latidue values in the NetCDF file provided by argument maskfiln.

varnam

A character string specifying the variable name in the data frame.

lonnam

A character string specifying the column name containing longitude values. Defaults to "lon}.}\item{latnam}{A character string specifying the column name containing longitude values. Defaults to \code{"lat.

Value

A 2D matrix