st_bivariate_contour_map: Produce points and density contour map for bivariate data

Description Usage Arguments Value Examples

View source: R/st_bivariate_contour_map.r

Description

Produce points and density contour map for bivariate data

Usage

1

Arguments

data

the data in long form, as returned from st_getAttributes or st_assign_colors. The first two columns should be the variables of interest.

Value

a ggplot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(stars)
# matched time to decadal time periods
time <- as.numeric(st_get_dimension_values(tmax, 2))
periods <- list(c(1950:1959), c(1960:1969), c(1970:1979), c(1980:1989),c(1990:1999))
decades <- lapply(periods, function(x, time) which(time %in% x), time)

# We wish to view data from 1990-1999
data = st_getAttributes(tmax[,,decades[[5]]], 1, tmin[,,decades[[5]]], 1)
colnames(data) = c("MaxTemp", "MinTemp")
st_bivariate_contour_map(data)

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