extractPts | R Documentation |
Extract data values for pixels selected from an image of a satin object.
extractPts(X, points = NULL)
X |
a satin object as returned by |
points |
a data frame with point(s) longitude and latitude coordinates where to extract data values. |
If provided, points
must have two columns with x and y coordinates. When not specified, points
can be selected by clicking on the image. Note that for selecting the points in this manner, the plot of the satin object has to be created using colbar = FALSE
.
A data frame with at least 7 columns: For each point, a sequential id
number; (x, y
) coordinates, either specified via the points
argument or selected by clicking on the image; (lon
and lat
) coordinates of pixels closer to the desired points; and for quality control purposes, the distance between them (d
, km). The remaining column(s) are the parameter values for every image in the satin object.
Héctor Villalobos
# load data, define coordinates and extract values data(dsst) plot(dsst) coord <- data.frame(x = seq(-130, -114, 2), y = seq(20, 36, 2)) values <- extractPts(dsst, points = coord) values # if no points are given the user can select them by clicking on the image if (interactive()){ plot(dsst, colbar = FALSE) values2 <- extractPts(dsst) # *** click on the image *** values2 }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.