clpatterns: Retrieve pattern or patterns

Description Usage Arguments Details Value Author(s) References Examples

View source: R/clpatterns.r

Description

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

Usage

1
2
3
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

1
2
3
4
5
6
7
8
9
## Not run: 
# Get a random pattern
clpatterns('random')

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

## End(Not run)

colourlovers documentation built on Jan. 13, 2021, 11:52 a.m.