assignColVar {GCDkit}R Documentation

Colours by a variable

Description

Assigns plotting colours according to the values of the variable.

Usage

assignColVar(what=NULL,pal="heat.colours",save=TRUE,n=15)

Arguments

what

variable name or a formula; if NULL a dialogue is displayed

pal

palette

save

should the newly picked colours be assigned to 'labels'?

n

Desired approximate number of colours to be assigned.

Details

For selection of the variable is employed the function 'selectColumnLabel'. The user can specify either existing data column in the 'WR' or a formula. The colours can be optionally (default behaviour) assigned globally, so that all the plots will use these from this point on. If not specified upon function call, the palette is picked using selectPalette. The possible values are: 'grays','reds','blues','greens','cyans','violets','yellows','cm.colors',
'heat.colors', 'terrain.colors','topo.colors', 'rainbow' and 'jet.colors'.
The analyses with no data available for the colours assignment will remain black.

Value

A list of two components, col and leg. The former are the plotting colours, the latter information to build a legend. If save = TRUE, 'labels$Colour' will acquire the codes of desired plotting colours.

Author(s)

Vojtech Janousek, vojtech.janousek@geology.cz

See Also

Colours by a single variable can be assigned by assignColLab, symbols and colours by groups simultaneously by assignSymbGroup. Uniform colours are obtained by assign1col. Table of available plotting colours is obtained by showColours.

Examples

    assignColVar("Na2O/K2O","greens")
    plotDiagram("PeceTaylor",F,F)

[Package GCDkit version 4.1 Index]