Description Usage Arguments Examples
Returns the colors of parties
1 2 3 4 5 6 7 8 9 |
ids |
A single id or vector of ids from the Party Facts data set. |
type |
The color model the colors should be in, can be hex, rgb, cmyk, or all (if all three types should be returned). Default is hex. |
websafe |
logical: should web safe colors be returned instead? Old browsers were not able to display other colors than these, with current browsers this option should not be necessary, default is FALSE. |
include_ids |
logical: should party facts ids be included in the output? If the colors get added to an existing data frame that already has the ids this is usually not helpful, default is FALSE. |
include_description |
logical: should the name of the color (e.g. "Dark blue") be included in the output? Default is FALSE. |
include_source |
logical: should the data source of the color be included in the output? Can be wikidata or wikipedia, default is FALSE. |
include_multiple |
logical: in some cases parties have multiple party colors, in these cases only one of them is included in this data set. Should information on whether the party has multiple colors according to the source, default is FALSE. |
1 2 3 4 5 6 7 8 | austrianparties <- data.frame(names=c("OEVP","SPOE","FPOE","Gruene","Neos"), partyfacts_id=c(1329,1384,463,1659,1970))
## this returns a simple vector of all hex triplets
austrianparties$color <- partycolor(austrianparties$partyfacts_id)
## this returns a data frame consisting of colors in all three color models, party facts ids,
color descriptions and color source.
austriancolors <- partycolor(austrianparties$partyfacts_id,
type='all', include_ids = TRUE,
include_description = TRUE, include_source = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.