Learn R Programming

puff (version 0.1.0)

create_site_map: Create a Site Map of Sensors and Sources

Description

This function generates a site map with an adjacent compass rose.

Usage

create_site_map(sensors, sources, text_size = 12)

Value

A patchwork-combined ggplot object: site map + compass rose.

Arguments

sensors

Coordinates for sensor locations.

sources

Coordinates for source locations.

text_size

Numeric. Font size for labels. Default is 12.

Examples

Run this code
source_coords <- c(0, 0, 2.5)

n_sensors <- 8
radius <- 20
z_height <- 2.0

angles <- seq(0, 2 * pi, length.out = n_sensors + 1)[- (n_sensors + 1)]

sensor_coords <- matrix(
  cbind(radius * cos(angles), radius * sin(angles), rep(z_height, n_sensors)),
  ncol = 3
)

create_site_map(sensor_coords, source_coords)

Run the code above in your browser using DataLab