rand_ncolors: Random Discrete Color Palette

View source: R/rand_ncolors.R

rand_ncolorsR Documentation

Random Discrete Color Palette

Description

Uses a data frame to create a vector of random color codes (one per row of data frame). This function uses a function created by Jason C Fisher at the United States Geological Survey (USGS).

Usage

rand_ncolors(df)

Arguments

df

This is the dataframe you want to use. Number of colors generated (i.e., length of char. vector) is the number of rows that df has.

Value

This function generates a character vector of hexadecimal color codes. This vector is then randomized using the sample function. Maximum of n is 256.

Author(s)

Andrew J. Van Leuven, vanleuven.3@osu.edu


andrewvanleuven/rleuven documentation built on July 19, 2022, 12:13 a.m.