I'm trying to work with a dataset of global sea surface salinity values that are conveniently provided in the packages oce and ocedata.
The issue is that I want more custom control over data aesthetics and the data arrive in a very weird structure: a large list with 4 elements of different lengths. It seems clear to me that lat and long values are different lengths, simple enough, but I cannot get the object reworked into a simple data frame (or raster object, that'd be fine too). I really do not want to use the canned function for plotting that these packages provide and instead want a straightforward dataframe (for ggplot).
Here are the data and their version of the plot:
install.packages(oce); install.packages(ocedata)
data(levitus, package="ocedata")
oce::imagep(levitus$longitude, levitus$latitude, levitus$SSS)
How can I convert the levitcus (sea surface salinity) data into a simple data frame with z values and xy coordinates?
