reshapeSatin: Reshape a satin object as a data frame

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/reshapeSatin.R

Description

An object of class “satin” is reshaped as a data frame with longitude, latitude and a column of remote sensed data for every image.

Usage

1
reshapeSatin(x, direction = "long")

Arguments

x

an object of class “satin” or a data frame produced with this function

direction

either “long”, when one wishes to reshape a satin object as a data frame or “wide”, when the opposite behavior is desired (see details).

Details

This is mainly an utility function called by cutSatin function. However, it may be useful when the user wants to arrange the satellite data 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 type of data and units of the remote sensed variable (“rs.name” and “rs.units”, respectively), and the period(s) averaged are preserved. Specifying direction = "wide" reverses the operation.

Value

When direction = "long" a data frame with at least three columns: “x”, “y” for longitude and latitude coordinates, and “rs.data” for the variable(s). When direction = "wide" a satin object as produced by read.oceancolor.

Author(s)

Héctor Villalobos

See Also

read.oceancolor

Examples

1
2
3
4
5
6
7
data(dbsst)
X <- reshapeSatin(dbsst, direction = "long")
head(X)
attributes(X)
Y <- reshapeSatin(X, direction = "wide")
str(Y)
plotSatin(Y)

r-forge/satin documentation built on Feb. 18, 2022, 2:39 a.m.