[Raster-commits] r474 - in pkg/raster: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Sep 2 22:36:14 CEST 2009
Author: rhijmans
Date: 2009-09-02 22:36:14 +0200 (Wed, 02 Sep 2009)
New Revision: 474
Removed:
pkg/raster/man/plotBbox.Rd
Modified:
pkg/raster/DESCRIPTION
pkg/raster/R/raster.R
pkg/raster/man/plot.Rd
pkg/raster/man/raster.Rd
pkg/raster/man/stats.Rd
pkg/raster/man/xyValues.Rd
Log:
Modified: pkg/raster/DESCRIPTION
===================================================================
--- pkg/raster/DESCRIPTION 2009-08-27 23:28:57 UTC (rev 473)
+++ pkg/raster/DESCRIPTION 2009-09-02 20:36:14 UTC (rev 474)
@@ -1,8 +1,8 @@
Package: raster
Type: Package
Title: Raster data handling for geographic data analysis and modeling
-Version: 0.9.1
-Date: 25-August-2009
+Version: 0.9.2
+Date: 2-September-2009
Depends: methods, sp, R (>= 2.8.0)
Suggests: rgdal (>= 0.5-33), RNetCDF
Author: Robert J. Hijmans & Jacob van Etten
Modified: pkg/raster/R/raster.R
===================================================================
--- pkg/raster/R/raster.R 2009-08-27 23:28:57 UTC (rev 473)
+++ pkg/raster/R/raster.R 2009-09-02 20:36:14 UTC (rev 474)
@@ -30,24 +30,31 @@
function(x, values=FALSE, band=1, proj=NULL, ...) {
fileext <- toupper(ext(x))
if ( fileext == ".GRD" | fileext == ".GRI" | fileext == "" ) {
+ if (fileext == "" & file.exists(x)) {
+ r <- .rasterFromGDAL(x, band)
+ }
grifile <- .setFileExtensionValues(x)
grdfile <- .setFileExtensionHeader(x)
if (file.exists( grdfile) ) {
if (file.exists( grifile)) {
r <- .rasterFromRasterFile(x, band)
} else {
- # TODO check if the problem is that the .gri is missing
- #
+ # TODO check if this is a valid rater .grd but the problem is that the .gri is missing?
- # check if this is a netcdf file
- fcon <- file("d:/data/ca.grd", "rb")
- w <- readBin(fcon, what='character', n=1)
- close(fcon)
- if (substr(w, 1, 3) == "CDF") {
- r <- .rasterFromNetCDF(x, ...)
+ if (fileext == ".GRD" ) {
+ # check if this is a netcdf file
+ fcon <- file(x, "rb")
+ w <- readBin(fcon, what='character', n=1)
+ close(fcon)
+ if (substr(w, 1, 3) == "CDF") {
+ r <- .rasterFromNetCDF(x, ...)
+ } else {
+ # perhaps a surfer grid...
+ r <- .rasterFromGDAL(x, band)
+ }
} else {
- # perhaps a surfer grid...
- r <- .rasterFromGDAL(x, band)
+ # what would this be? A gri, but no grd.
+ stop('unknown file type; .gri file found but .grd is missing')
}
}
} else {
Modified: pkg/raster/man/plot.Rd
===================================================================
--- pkg/raster/man/plot.Rd 2009-08-27 23:28:57 UTC (rev 473)
+++ pkg/raster/man/plot.Rd 2009-09-02 20:36:14 UTC (rev 474)
@@ -6,6 +6,8 @@
\alias{plot,RasterLayer,missing-method}
\alias{plot,RasterStack,ANY-method}
\alias{plot,RasterLayer,RasterLayer-method}
+\alias{plot,BoundingBox,ANY-method}
+\alias{plot,BoundingBox,missing-method}
\title{Plot a Raster* object}
@@ -62,6 +64,15 @@
\tab \code{cex} \tab point size \cr
\tab \code{...} \tab Any argument that can be passed to \code{\link[graphics]{plot}} \cr
}
+
+\bold{x=BoundingBox, y="ANY"}
+Draws the (rectangular) bounding box of a raster object.
+\code{plot(ext) }
+
+\tabular{rll}{
+\tab \code{ext} \tab a BoundingBox object \cr
+}
+
}}
@@ -82,6 +93,7 @@
r <- raster(nrows=36, ncols=18)
r <- setValues(r, runif(ncell(r)))
plot(r)
+plot(extent(r))
}
\keyword{methods}
Deleted: pkg/raster/man/plotBbox.Rd
===================================================================
--- pkg/raster/man/plotBbox.Rd 2009-08-27 23:28:57 UTC (rev 473)
+++ pkg/raster/man/plotBbox.Rd 2009-09-02 20:36:14 UTC (rev 474)
@@ -1,37 +0,0 @@
-\name{plotBbox}
-
-\docType{methods}
-
-\alias{plot,BoundingBox,ANY-method}
-\alias{plot,BoundingBox,missing-method}
-
-
-\title{Methods for Function plot in Package `raster'}
-
-\description{
- Methods for function \code{plot} in Package `raster'
-
- \code{plot} can also be supplied with the two RasterLayer objects, creating a scatter plot (if they have matching extent and resolution)
-
-}
-
-\section{Methods}{
-\describe{
-
-Methods for function \code{plot}
-
-\item{x = "Raster", y = "missing"}{creates a plot of raster values; see \code{\link[raster]{map}} }
-
-\item{x = "RasterLayer", y = "RasterLayer"}{ xy plot of RasterLayer values }
-
-\item{x = "BoundingBox", y = "ANY"}{ plot a BoundingBox object }
-
-}}
-
-
-\seealso{ \code{\link[raster]{plot}} }
-
-
-\keyword{methods}
-\keyword{spatial}
-
Modified: pkg/raster/man/raster.Rd
===================================================================
--- pkg/raster/man/raster.Rd 2009-08-27 23:28:57 UTC (rev 473)
+++ pkg/raster/man/raster.Rd 2009-09-02 20:36:14 UTC (rev 474)
@@ -45,7 +45,7 @@
}
If \code{x} is a character value, it should be a filename of a file that the raster package can read. Supported file types are the
-'native' raster package format and those that can be read via rgdal. See \code{\link[gdal]{readGDAL}} help for supported file types.
+'native' raster package format and those that can be read via rgdal. See \code{\link[rgdal]{readGDAL}} help for supported file types.
@@ -123,8 +123,8 @@
\details{
New RasterLayer objects normally have no values in memory.
-You can get values into memory with \code{\link[raster]{readRow}}, and \code{\link[raster]{readAll}}; extract values with \code{\link[raster]{xyValues}};
-Or set values with \code{\link[raster]{Replacement}} functions.
+You can get values into memory with \code{\link[raster]{read}*}, functions; extract values with \code{\link[raster]{xyValues}};
+Or set values with \code{\link[raster]{replaceMethods}}.
}
@@ -134,7 +134,7 @@
\author{Robert J. Hijmans}
-\seealso{ \code{\link[raster]{stack}, \link[raster]{values}, \link[gdal]{readGDAL} } }
+\seealso{ \code{\link[raster]{stack}, \link[raster]{values}, \link[rgdal]{readGDAL} } }
\examples{
Modified: pkg/raster/man/stats.Rd
===================================================================
--- pkg/raster/man/stats.Rd 2009-08-27 23:28:57 UTC (rev 473)
+++ pkg/raster/man/stats.Rd 2009-09-02 20:36:14 UTC (rev 474)
@@ -29,7 +29,7 @@
}
\value{
- Mode returns the modal (most frequent) value of a vector of values, ties are broken at random
+ modal returns the mode, or modal (most frequent) value of a vector of values, ties are broken at random.
cv returns the coefficient of variation (expressed as a percentage). If there is only a single value, \code{sd} is \code{NA}
and \code{cv} returns \code{NA} if \code{aszero=FALSE} (the default). However, if (\code{aszero=TRUE}), \code{cv} returns \code{0}.
}
Modified: pkg/raster/man/xyValues.Rd
===================================================================
--- pkg/raster/man/xyValues.Rd 2009-08-27 23:28:57 UTC (rev 473)
+++ pkg/raster/man/xyValues.Rd 2009-09-02 20:36:14 UTC (rev 474)
@@ -50,7 +50,7 @@
a vector (object is a RasterLayer) or a matrix (object is a RasterStack)
}
-\seealso{ \code{\link[raster]{cellValues}}, \code{\link[raster]{readRow}}, \code{\link[raster]{readAll}}, \code{\link[sp]{SpatialPoints}} }
+\seealso{ \code{\link[raster]{cellValues}}, \code{\link[raster]{read}}, \code{\link[sp]{SpatialPoints}} }
\author{Robert J. Hijmans }
More information about the Raster-commits
mailing list