[Raster-commits] r397 - in pkg/raster: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Apr 6 14:15:36 CEST 2009
Author: rhijmans
Date: 2009-04-06 14:15:35 +0200 (Mon, 06 Apr 2009)
New Revision: 397
Modified:
pkg/raster/R/dataProperties.R
pkg/raster/R/depracated.R
pkg/raster/man/expand.Rd
pkg/raster/man/properties.Rd
pkg/raster/man/rasterFromFile.Rd
pkg/raster/man/round.Rd
pkg/raster/man/setDatatype.Rd
Log:
Modified: pkg/raster/R/dataProperties.R
===================================================================
--- pkg/raster/R/dataProperties.R 2009-04-06 10:02:37 UTC (rev 396)
+++ pkg/raster/R/dataProperties.R 2009-04-06 12:15:35 UTC (rev 397)
@@ -25,8 +25,8 @@
}
-dataType <- function(object) {
- return(object at file@datanotation)
+dataType <- function(x) {
+ return(x at file@datanotation)
}
dataContent <- function(object) {
Modified: pkg/raster/R/depracated.R
===================================================================
--- pkg/raster/R/depracated.R 2009-04-06 10:02:37 UTC (rev 396)
+++ pkg/raster/R/depracated.R 2009-04-06 12:15:35 UTC (rev 397)
@@ -4,32 +4,11 @@
#}
-setDatatype <- function(x, value) {
- warning('depracated function. Use "dataType(x) <- value"')
- dataType(x) <- value
- return(x)
-}
-
-
-setRaster <- function(object, filename="", values=NULL) {
- warning('depracated, use "raster()" instead')
- return(raster(x=object, filename=filename, values=values))
-}
-
-rasterFromBbox <- function(bndbox, nrows=10, ncols=10) {
- warning("'rasterFromBbox' is deprecated. Use 'raster(bbox, ...)' instead")
- return(raster(x=bndbox, nrows=nrows, ncols=ncols))
-}
-
rasterFromFile <- function(filename, values=FALSE, band=1) {
- warning("'rasterFromFile' is deprecated. Use 'raster(filename)' instead")
- return(raster(x=filename, values=values, band=band))
+ stop("'rasterFromFile' is deprecated. Use 'raster(filename)' instead")
}
-# no longer used. Use calc instead. See ?calc
-
-
...isNA <- function(raster, value=0, filename="", overwrite=FALSE, asInt=FALSE) {
fun <- function(x) { x[is.na(x)] <- value; return(x)}
if (asInt) { datatype <- 'INT4S' } else { datatype <- 'FLT4S' }
Modified: pkg/raster/man/expand.Rd
===================================================================
--- pkg/raster/man/expand.Rd 2009-04-06 10:02:37 UTC (rev 396)
+++ pkg/raster/man/expand.Rd 2009-04-06 12:15:35 UTC (rev 397)
@@ -2,7 +2,7 @@
\alias{expand}
-\title{expand}
+\title{Expand}
\description{
Expand returns an RasterLayer with a larger spatial extent.
Modified: pkg/raster/man/properties.Rd
===================================================================
--- pkg/raster/man/properties.Rd 2009-04-06 10:02:37 UTC (rev 396)
+++ pkg/raster/man/properties.Rd 2009-04-06 12:15:35 UTC (rev 397)
@@ -1,30 +1,28 @@
\name{properties}
-\alias{dataType}
\alias{dataSize}
\alias{dataSigned}
-\title{Raster properties}
+\title{Raster file properties}
\description{
- Properties of Raster* objects
+ Properties of the values of the file that a RasterLayer object points to
+
+ \code{dataSize} returns the number of bytes used for each value (pixel, grid cell)
+ \code{dataSigned} is TRUE for data types that include negative numbers.
+
}
\usage{
dataSize(object)
dataSigned(object)
-dataType(object)
}
\arguments{
\item{object}{Raster* object}
}
-\note{
- Some of these functions simply take the values from the data slots in the RasterLayer or RasterStack object. It is advisable to use these and other 'getter' functions rather than dirctly accessing the slots of an object. This will ensure that code will not break in the future, even if the underlying class definitions change.
-}
-
\seealso{ \code{\link[raster]{filename}} }
@@ -35,11 +33,12 @@
\author{Robert J. Hijmans }
\examples{
-#using a new default raster (1 degree global)
-r <- raster(nrow=10, ncol=10)
+r <- raster(system.file("external/test.ag", package="sp"))
+dataSize(r)
+dataSigned(r)
+dataType(r)
+
dataContent(r)
-r[] <- 1:ncell(r)
-dataContent(r)
dataSource(r)
}
Modified: pkg/raster/man/rasterFromFile.Rd
===================================================================
--- pkg/raster/man/rasterFromFile.Rd 2009-04-06 10:02:37 UTC (rev 396)
+++ pkg/raster/man/rasterFromFile.Rd 2009-04-06 12:15:35 UTC (rev 397)
@@ -2,19 +2,15 @@
\alias{rasterFromFile}
-\alias{rasterFromBbox}
-\alias{setRaster}
\title{Create a RasterLayer}
\description{
- These function have been depracated. Use \code{link[raster]{raster}} instead.
+ This function has been depracated. Use \code{link[raster]{raster}} instead.
}
\usage{
rasterFromFile(filename, values=FALSE, band=1)
-rasterFromBbox(bndbox, nrows=10, ncols=10)
-setRaster(object, filename="", values=NULL)
}
@@ -22,15 +18,11 @@
\item{filename}{name of raster data file }
\item{band}{band number in case of a file of multiple bands, default = 1 }
\item{values}{logical. If \code{TRUE}, RasterLayer values will be read into memory with 'readAll()'; or the values to associate with the RasterLayer object }
- \item{bndbox}{a BoundingBox object}
- \item{nrows}{number of rows on raster }
- \item{ncols}{number of columns on raster }
- \item{object}{A Raster* object }
}
\value{
-RasterLayer object
+A RasterLayer object
}
\author{Robert J. Hijmans}
Modified: pkg/raster/man/round.Rd
===================================================================
--- pkg/raster/man/round.Rd 2009-04-06 10:02:37 UTC (rev 396)
+++ pkg/raster/man/round.Rd 2009-04-06 12:15:35 UTC (rev 397)
@@ -7,7 +7,7 @@
\alias{ceiling,RasterLayer-method}
\alias{floor,RasterLayer-method}
-\title{ Create integer values }
+\title{integer values}
\description{
These functions take a single RasterLayer argument \code{x} and change its values to integers.
Modified: pkg/raster/man/setDatatype.Rd
===================================================================
--- pkg/raster/man/setDatatype.Rd 2009-04-06 10:02:37 UTC (rev 396)
+++ pkg/raster/man/setDatatype.Rd 2009-04-06 12:15:35 UTC (rev 397)
@@ -1,16 +1,17 @@
\name{setDatatype}
\alias{dataType<-}
-\alias{setDatatype}
+\alias{dataType}
-\title{ Set data type }
+\title{data type }
\description{
-Use these functions to set the datatype properties of a RasterLayer object. The datatype determines how values are written to disk.
-It does not affect the way they are stored in memory.
+Get or set the datatype of a RasterLayer object. The datatype determines how values are stored on or written to disk.
+It does not directly affect the way they are stored in memory.
}
\usage{
+dataType(x)
dataType(x) <- value
}
@@ -54,6 +55,7 @@
\examples{
r <- raster()
+dataType(r)
# 2 byte signed integer
dataType(r) <- "INT2S"
# 2 byte unsigned integer
More information about the Raster-commits
mailing list