[Raster-commits] r352 - in pkg/raster: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Mar 14 02:17:34 CET 2009


Author: rhijmans
Date: 2009-03-14 02:17:34 +0100 (Sat, 14 Mar 2009)
New Revision: 352

Modified:
   pkg/raster/R/raster.R
   pkg/raster/man/rasterFromFile.Rd
Log:


Modified: pkg/raster/R/raster.R
===================================================================
--- pkg/raster/R/raster.R	2009-03-13 15:54:27 UTC (rev 351)
+++ pkg/raster/R/raster.R	2009-03-14 01:17:34 UTC (rev 352)
@@ -5,6 +5,11 @@
 # Licence GPL v3
 
 
+rasterFromBbox <- function(bndbox, nrows=10, ncols=10) {
+	warning("'rasterFromBbox' is deprecated. Use 'raster(bbox, ...)' instead")
+	return(raster(bndbox=bndbox, nrows=nrows, ncols=ncols))
+}
+
 rasterFromFile <- function(filename, values=FALSE, band=1) {
 	warning("'rasterFromFile' is deprecated. Use 'raster(filename)' instead")
 	return(raster(filename, values=values, band=band))
@@ -25,10 +30,11 @@
 )
 
 setMethod('raster', signature(x='Raster'), 
-	function(x, filename="", values=NULL) {
+	function(x, filename="", values=NULL, layer=1) {
 	
 		if (class(x) == 'RasterStack') { 
-			x <- asRasterLayer(x, 1) 
+			
+			x <- asRasterLayer(x, layer) 
 		}
 		if (class(x) != 'RasterLayer') { stop('the first argument should be a RasterLayer or a RasterStack object') }
 
@@ -79,3 +85,4 @@
 	return(raster) 
 }
 )
+

Modified: pkg/raster/man/rasterFromFile.Rd
===================================================================
--- pkg/raster/man/rasterFromFile.Rd	2009-03-13 15:54:27 UTC (rev 351)
+++ pkg/raster/man/rasterFromFile.Rd	2009-03-14 01:17:34 UTC (rev 352)
@@ -5,8 +5,7 @@
 \title{RasterLayer from file}
 
 \description{
-  Create a new RasterLayer object from a file. The created object does normally not contain any cell (pixel) values, 
-  it only has the parameters that describe the RasterLayer.
+  This function has been depracated. Use \code{link[raster]{raster}} instead.
 }
 
 \usage{
@@ -19,19 +18,13 @@
   \item{values}{logical. If \code{TRUE}, RasterLayer values will be read into memory with 'readAll()'}
 }
 
-\details{
- Supported file types are the 'native' raster package format and those that can be read via rgdal. See ?readGDAL help for supported file types.
- See read* and values() for access to the values. 
-}
 
 \value{
 RasterLayer object
 }
+
 \author{Robert J. Hijmans}
 
-\seealso{ \code{\link[raster]{readAll}, \link[raster]{values},  \link[raster]{raster}, \link[raster]{stack},  \link[gdal]{readGDAL} } }
-\examples{
-r <- rasterFromFile(system.file("external/test.ag", package="sp"))
-}
+\seealso{ \code{\link[raster]{raster}} }
 
 \keyword{spatial }



More information about the Raster-commits mailing list