Retrieve basic statistics from COLOURlovers.

Share:

Description

Retrieve basic statistics from the COLOURlovers API.

Usage

1
clstats(type, fmt = 'xml')

Arguments

type

An API type. One of “colors”, “palettes”, “patterns”, or “lovers”.

fmt

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

Details

Retrieve total numbers of colors, palettes, patterns, or lovers.

Value

A list of class “clstats” containing at least one named element (“total”). This should be the same regardless of the value of fmt.

Author(s)

Thomas J. Leeper

References

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

Examples

1
2
3
4
5
6
e <- function(e) NULL # function for tryCatch to fail in examples

tryCatch( clstats('colors'), error = e)
tryCatch( clstats('palettes'), error = e)
tryCatch( clstats('patterns'), error = e)
tryCatch( clstats('lovers'), error = e)