colorize: Create color table

Description Usage Arguments Details Value Author(s) See Also Examples

Description

colorize assigns color table to raster image.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
colorize(obj, value = NULL, breakvalue = NULL, name = NULL, pal = NULL, inv = NA,
         stretch = c("default", "linear", "equal", "mean", "positive",
                     "negative", "diff", "category", "julian", "date", "time",
                     "slope", "conc", "sd", "significance", "bathy",
                     "grayscale", "greyscale", ".onetoone"),
         minvalue = NA, maxvalue = NA, byvalue = NA, ltail = NA, rtail = NA, tail = NA,
         ncolor = NA, nbreak = NA, interval = 0L, ramp = TRUE, byte = FALSE,
         lazyload = FALSE, reset = FALSE, origin = "1970-01-01" ,format = "",
         alpha = "", colortable = NULL, verbose = FALSE, ...)
                          

Arguments

obj

ursaRaster object or one-dimension numeric vector.

value

Numeric. Values to be assigned to categories.

breakvalue

Numeric. Values to be assigned to intervals.

name

Character. Names of categories.

pal

Function or character. If function then value should corresponded to function, which creates a vector of colors. If character then values should correponded to R color names or hexadecimal string of the form "#RRGGBB" or "#RRGGBBAA".

inv

Logical. Invert sequence of colors.

stretch

Character. Either kind of value transformatin ("linear", "equal") or pre-defined options with palette specification ("positive", "data", "significance", etc)

minvalue

Numeric. Lower range limit.

maxvalue

Numeric. Upper range limit.

byvalue

Numeric. Increment of the sequence from minvalue to maxvalue.

ltail

Numeric. Partition of omitted values at left tail.

rtail

Numeric. Partition of omitted values at right tail.

tail

Numeric. Partition of omitted values at both tail. If length of tail is 2 then left and right tails may differ.

ncolor

Numeric or interer. Number of desired colors (or categories)

nbreak

Numeric or interer. Number of desired separators between colors.

interval

Integer. How to underwrite categories? Use direct

ramp

Logical. Is color ramp required?

byte

Logical. Forcing to produce color table for storage in byte format (not more than 255 colors). Default is FALSE.

lazyload

Logical. If FALSE then raster is reclassified to categories. If TRUE then color table is created without any change to source raster. Default is FALSE.

reset

Logical. If TRUE and source raster has color table, then this color table is destroyed, and new one is created. Default is FALSE.

origin

Character. Origin for stretch="date" (passed to function as.Date) and stretch="time" (passed to function as.POSIXct). See desription of orogin in respective functions. Default is "1970-01-01".

format

Character. Format date/time objects for arguments stretch with values "date", "time", or "julian". Default is "" (character of length 0).

alpha

Character or numeric. The characteristics of transparency. If character, then hexadecimal values between "00" and "FF" are allowed, and then coerced to numeric value between 0 and 255. If numeric, and 0 <= alpha <= 1, then alpha is multiplied to 255. alpha=0 means full transparency, alpha=255 means full opacity. Default is ""; if palette has no alpha channel, then alpha is assing to "FF".

colortable

Object of class ursaColorTable or object of class ursaRaster with color table. Reference color table. Is specified, then all other arguments are ignored, expexted lazyload. Default is NULL (unspecified).

verbose

Logical. Some output in console. Primarily for debug purposes.

...

If pal is a function, and argrument names are in the format "pal.*" then prefix "pal." is omitted, and the rest part is used for argument names, which are passed to pal function.

Details

colortable is designed to prepare pretty thematic maps.

Color rampimg (ramp=TRUE) is not quick in computatons and has no effective labelling. It is intoduced to visualize non-thematic maps, and it is assumed that labeling can be omitted for such maps.

The labelling implementation is based on some improvements of pretty function. The notation of intervals is mixed by brackets and comparative symbols, for example: "<=1.5","(1.5,2.5]","(2.5,3.5]",">3.5"

Reserved values for interval:

Keywords for stretch to create pre-defined color tables:

It is allowed manual correction of labels using followed code example: names(ursa_colortable(x)) <- c("a<=0","0<a<=1","a>1")

Value

Object of class ursaRaster with named character vector of item $colortable

Author(s)

Nikita Platonov [email protected]

See Also

ursa_colortable, ursa_colortable<-

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
session_grid(NULL)
a <- pixelsize()-350
print(a)
b1 <- colorize(a,ramp=FALSE)
print(ursa_colortable(b1))
b2 <- colorize(a,interval=1,stretch="positive",ramp=FALSE)
print(ursa_colortable(b2))
b3 <- colorize(a,interval=2,stretch="positive",ramp=FALSE)
print(ursa_colortable(b3))
b4 <- colorize(a,value=c(150,250),interval=1)
print(ursa_colortable(b4))
names(ursa_colortable(b4)) <- c("x<=150","150<x<=250","x>250")
print(ursa_colortable(b4))
display(b4)

nplatonov/ursa documentation built on April 15, 2019, 10:49 a.m.