assign_colors.df: Bin bivariate ST data and assign colors

Description Usage Arguments Value Examples

View source: R/assign_colors_df.R

Description

Bin bivariate ST data and assign colors

Usage

1

Arguments

data

a data frame with the variables of interest in the first two columns.

bounds

How should the data be binned? Use custom bounds or those returned from st_findNbounds.

palette

A palette built using Vizumap::build_palette or st_build_palette.

Value

data with two extra columns: bothVars, a factor, and hex_code, the color corresponding to each data point.

Examples

1
2
3
4
5
6
7
8
9
temps.DF = as.data.frame(tmax)
names(temps.DF)[3] = "tmax"
tmin.DF = as.data.frame(tmin)

temps.DF$tmin = tmin.DF$tmin.nc
temps.DF = temps.DF[,c(3,4,1,2)]

bounds = st_findNbounds(temps.DF)
temps.DF = assign_colors.df()

JamesMCollier/densityviz documentation built on Dec. 18, 2021, 12:31 a.m.