GDALReadOnlyDataset-class.RdGDALReadOnlyDataset is the base class for a GDAL Dataset
  classes. Only read operations are supported. Both GDALDataset
  and GDALTransientDataset inherit these read operations while
  providing additional write operations (see
  GDALDataset-class). GDALReadOnlyDataset-class inherits
  from GDALMajorObject-class.
GDAL.close(dataset)
GDAL.open(filename, read.only = TRUE, silent=FALSE,
                 allowedDrivers = NULL, options=NULL)
getDriver(dataset)
<!-- %displayDataset(x, offset = c(0, 0), region.dim = dim(x), -->
<!-- %                           reduction = 1, band = NULL, col = NULL, -->
<!-- %                           max.dim = 500, ...) -->
getColorTable(dataset, band = 1)
getGeoTransFunc(dataset)Objects can be created by calls of the form new("GDALReadOnlyDataset", filename, handle).
    ~~ describe objects here ~~
handle:Object of class "externalptr", from class "GDALMajorObject" ~~
Class "GDALMajorObject", directly.
signature(dataset = "GDALReadOnlyDataset"): ...
signature(x = "GDALReadOnlyDataset"): ...
signature(.Object = "GDALReadOnlyDataset"): ...
An object inheriting from class 'GDALReadOnlyDataset'
name of file to contain raster data object; will be normalized with normalizePath if it is a file
The band number (1-based) to read from
A logical flag indicating whether to open the file as a
  GDALReadOnlyDataset or as a writable GDALDataset
logical; if TRUE, comment and non-fatal CPL driver errors suppressed
a character vector of suggested driver short names may be provided starting from GDAL 2.0
open options may be passed to raster drivers starting from GDAL 2.0; very few drivers support these options
GDAL.open and GDAL.close are shorter versions of new("GDALReadOnlyDataset", ...) and closeDataset(). Because GDAL.close through closeDataset() uses the finalization mechanism to destroy the handles to the dataset and its driver, messages such as:
"Closing GDAL dataset handle 0x8ff7900... destroyed ... done."
may appear when GDAL.close is run, or at some later stage. 
getDriver returns an object inheriting from class 'GDALDriver'.
getColorTable returns the dataset colour table (currently does not support RGB imaging).
getGeoTransFunc returns a warping function.
logo <- system.file("pictures/logo.jpg", package="rgdal")[1]
x <- new("GDALReadOnlyDataset", logo)
dim(x)
#> [1] 175 200
plot(density(getRasterTable(x)$band1))
#> Warning: GeoTransform values not available
 #displayDataset(x)
#displayDataset(x, col=function(x){rev(cm.colors(x))})
#im <- displayDataset(x, col=function(x){rev(cm.colors(x))}, reset.par=FALSE)
#contour(1:attr(im, "size")[2], 1:attr(im, "size")[1],
# t(attr(im, "index"))[,attr(im, "size")[1]:1], nlevels = 1,
# levels = 100, col = 'black', add = TRUE)
GDAL.close(x)
logo <- system.file("pictures/Rlogo.jpg", package="rgdal")[1]
x <- new("GDALReadOnlyDataset", logo)
dim(x)
#> [1] 175 200   3
#displayDataset(x)
GDAL.close(x)
#displayDataset(x)
#displayDataset(x, col=function(x){rev(cm.colors(x))})
#im <- displayDataset(x, col=function(x){rev(cm.colors(x))}, reset.par=FALSE)
#contour(1:attr(im, "size")[2], 1:attr(im, "size")[1],
# t(attr(im, "index"))[,attr(im, "size")[1]:1], nlevels = 1,
# levels = 100, col = 'black', add = TRUE)
GDAL.close(x)
logo <- system.file("pictures/Rlogo.jpg", package="rgdal")[1]
x <- new("GDALReadOnlyDataset", logo)
dim(x)
#> [1] 175 200   3
#displayDataset(x)
GDAL.close(x)