plotPalette {colouR}R Documentation

plotPalette

Description

Plot a color palette from a data frame. This function takes a vector of colours or a data frame with a column of colors and plots the colors as a color palette.

Usage

plotPalette(df, color_col)

Arguments

df

A vector of colours or a data frame containing a column with colors in hexadecimal format.

color_col

A character string representing the name of the column containing the colors.

Value

A ggplot2 plot object displaying the color palette.

Examples

# Create a sample data frame with colors
colors_df <- data.frame(
  color = c("#FF0000", "#00FF00", "#0000FF", "#FFFF00", "#FF00FF")
)

# Plot the color palette with default bar height
plotPalette(colors_df, "color")


[Package colouR version 0.1.1 Index]