satinDataframe {satin} | R Documentation |
Reshape a satin object into a data frame
Description
A satin object is reshaped as a data frame with longitude, latitude and remote sensed data column(s).
Usage
satinDataframe(X, reverse = FALSE)
Arguments
X |
a satin object as returned by |
reverse |
logical, |
Details
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.
Value
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.
Author(s)
Héctor Villalobos
Examples
# 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)