[Raster-commits] r145 - pkg/raster/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Jan 16 06:55:47 CET 2009
Author: rhijmans
Date: 2009-01-16 06:55:47 +0100 (Fri, 16 Jan 2009)
New Revision: 145
Modified:
pkg/raster/R/click.R
Log:
Modified: pkg/raster/R/click.R
===================================================================
--- pkg/raster/R/click.R 2009-01-16 05:46:58 UTC (rev 144)
+++ pkg/raster/R/click.R 2009-01-16 05:55:47 UTC (rev 145)
@@ -7,7 +7,6 @@
# Licence GPL v3
-
click <- function(object, n=1, xy=FALSE, type = "n", ...) {
loc <- locator(n)
x <- loc$x
@@ -17,16 +16,16 @@
if (dataSource(object) != 'disk') {
stop('no data associated with this RasterLayer object')
} else {
- return(xyValues(object, xyCoords))
+ value <- xyValues(object, xyCoords)
}
} else {
cell <- cellFromXY(object, xyCoords)
value <- values(object)[cell]
- if (xy) {
- return(cbind(xyCoords, value))
- } else {
- return(value)
- }
}
+ if (xy) {
+ return(cbind(xyCoords, value))
+ } else {
+ return(value)
+ }
}
More information about the Raster-commits
mailing list