View source: R/satinDataframe.R
satinDataframe | R Documentation |
A satin object is reshaped as a data frame with longitude, latitude and remote sensed data column(s).
satinDataframe(X, reverse = FALSE)
X |
a satin object as returned by |
reverse |
logical, |
This is mainly an utility function called by crop
, extractPts
, and pixelate
functions. However, it may be useful when the user wants to arrange the ocean data variables stored in a satin object as a data frame, with rows representing pixels whose longitude and latitude coordinates are in the first two columns and their data values in the remaining column(s). The attributes describing the data (name, units, period, etc.) are preserved. Specifying reverse = TRUE
reverses the operation.
When reverse = FALSE
, a data frame with at least three columns: "x", "y" for longitude and latitude coordinates, and data for the variable(s). When reverse = TRUE
a satin object as produced.
Héctor Villalobos
# load sample SST data data(dsst) # reshape into a data frame X <- satinDataframe(dsst) head(X) # reverse the operation Y <- satinDataframe(X, reverse = TRUE) Y plot(Y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.