File: dimensions.Rd

package info (click to toggle)
r-cran-raster 3.6-31-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,300 kB
  • sloc: cpp: 2,367; ansic: 1,572; sh: 13; makefile: 2
file content (49 lines) | stat: -rw-r--r-- 980 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
\name{dim}

\alias{dim}
\alias{dim,RasterStackBrick-method}
\alias{dim,BasicRaster-method}
\alias{dim<-,BasicRaster-method}
\alias{dim<-,RasterLayer-method}
\alias{dim<-,RasterBrick-method}

\docType{methods}

\title{Dimensions of a Raster* object}

\description{
Get or set the number of rows, columns, and layers of a Raster* object. You cannot use this function to set the dimensions of a RasterStack object.

When setting the dimensions, you can provide a row number, or a vector with the row and the column number (for a RasterLayer and a RasterBrick), or a row and column number and the number of layers (only for a RasterBrick)
}

\usage{
\S4method{dim}{BasicRaster}(x)
}

\arguments{
 \item{x}{Raster(* object}
}

\value{
Integer or Raster* object
}
\seealso{ \code{ \link{ncell}, \link{extent}, \link{res} } } 



\examples{
r <- raster()
dim(r)
dim(r) <- c(18) 
dim(r)
dim(r) <- c(18, 36) 
dim(r)
b <- brick(r)
dim(b)
dim(b) <- c(10, 10, 5)
dim(b)
}

\keyword{spatial}