Learn R Programming

plutor (version 0.1.0)

assign_colors: assign colors by a column in a tibble, for the convenience to use scale_color_identity()

Description

assign colors by a column in a tibble, for the convenience to use scale_color_identity()

Usage

assign_colors(df, by, colors = sci_colors("npg", 10), na = "#F5F5F5")

Value

tibble

Arguments

df

tibble

by

assign colors according to this column

colors

a vector of color values

na

if colors are not enough, fill na values

Examples

Run this code
assign_colors(mini_diamond, cut, colors = sci_colors("nejm", 8))

Run the code above in your browser using DataLab