clpatterns {colourlovers}R Documentation

Retrieve pattern or patterns

Description

Retrieve a pattern or set of patterns from the COLOURlovers API.

Usage

clpatterns(set = NULL, ..., fmt = "xml")

clpattern(id, fmt = "xml")

Arguments

set

Optionally, a subset of COLOURlovers patterns. Allowed values are “new”, “top”, and “random”.

...

A named list of parameters passed to the API request. Allowed parameters are lover, hueOption, hex, hex_logic, keywords, keywordExact, orderCol, sortBy, numResults, and resultOffset. Specifying orderCol overrules any argument to set. See details.

fmt

A format for the API response, one of “xml” (the default) or “json”. This has essentially no effect on function behavior.

id

The COLOURlovers id (an integer) for a specific pattern.

Details

Retrieve details about a pattern or set of patterns.

Specifying named arguments to ... allows the user to request a specific response, as follows:

Value

A list of class “clpattern”. This should be the same regardless of the value of fmt.

Author(s)

Thomas J. Leeper

References

http://www.colourlovers.com/api/#patterns

Examples

## Not run: 
# Get a random pattern
clpatterns('random')

# Plot a single pattern
p <- clpattern('1451', fmt = 'json')
plot(p)

## End(Not run)

[Package colourlovers version 0.3.6 Index]