gl.select.shapes: Selects shapes from the base R shape palette and outputs as a...

View source: R/gl.select.shapes.r

gl.select.shapesR Documentation

Selects shapes from the base R shape palette and outputs as a vector

Description

This script draws upon the standard R shape palette to extract a vector of shapes for plotting, where the script that follows has a shape parameter expecting a vector of shapes.

Usage

gl.select.shapes(x = NULL, select = NULL, verbose = NULL)

Arguments

x

Optionally, provide a gl object from which to determine the number of populations [default NULL].

select

Select the shapes to retain in the output vector [default NULL, all shapes shown and returned].

verbose

Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default 2 or as specified using gl.set.verbosity].

Details

By default the shape palette will be displayed in full in the graphics window from which shapes can be selected in a subsequent run, and the vector of shapes returned for later use.

The select parameter can be used to select shapes from the specified 26 shapes available (0-25). For example, select=c(1,1,3) will select shape 1, 1 again and 3 to retain in the final vector. This can be useful for fine-tuning shape selection, and matching colors and shapes.

Value

A vector with the required number of shapes

Author(s)

Custodian: Arthur Georges – Post to https://groups.google.com/d/forum/dartr

See Also

gl.select.colors

Other Exploration/visualisation functions: gl.pcoa.plot(), gl.select.colors(), gl.smearplot()

Examples

# SET UP DATASET
gl <- testset.gl
levels(pop(gl))<-c(rep('Coast',5),rep('Cooper',3),rep('Coast',5),
rep('MDB',8),rep('Coast',7),'Em.subglobosa','Em.victoriae')
# EXAMPLES
shapes <- gl.select.shapes() # Select and display available shapes
# Select and display a restricted set of shapes
shapes <- gl.select.shapes(select=c(1,1,1,5,8)) 
 # Select set of shapes and check with no. of pops.
shapes <- gl.select.shapes(x=gl,select=c(1,1,1,5,8))

dartR documentation built on June 8, 2023, 6:48 a.m.