read.gis.pal: Convert a GRASS text color table to an R palette.

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

View source: R/read.gis.pal.R

Description

Reads and parses a GRASS GIS color table from a text file or directly. Either filename or text must be specified.

Usage

1
read.gis.pal(filename, text)

Arguments

filename

The name of a text file containing a GRASS GIS color table.

text

The text of a GRASS GIS color table.

Details

GRASS GIS color tables can mix percentages and data values, and named and RGB color specifications. This function imports them into a palette format usable in R.

Value

Returns a data frame with three columns:

value

The data value or percentage associated with each color.

pct

TRUE if the entry is a percentage; FALSE for a data value.

color

Color specification in hexadecimal format.

Author(s)

Sarah Goslee

References

More information on GRASS GIS color tables is available from the manual at https://grass.osgeo.org/grass70/manuals/r.colors.html.

See Also

display.gis.pal, gis.pal.info

Examples

1
2
3
4
5
6
7
samplepal <- read.gis.pal(text =
"0 black
10
78 blue
100
nv white")
display.gis.pal(pal=samplepal)

phiala/giscolor documentation built on Jan. 28, 2020, 3:35 a.m.