left_join_range: Function to join two data frames together based on a range...

View source: R/left_join_range.R

left_join_rangeR Documentation

Function to join two data frames together based on a range condition.

Description

left_join_range will test if a variable in table x is within a range of two variables in table y and join the other variables if TRUE.

Usage

left_join_range(x, y, x_test, y_min, y_max, keep = FALSE)

Arguments

x, y

Data frames to join.

x_test

Variable name in x which should be tested for a range.

y_min, y_max

Variables in y which define the range for the test against x_test.

keep

Should the y_min and y_max be kept in the joined return?

Author(s)

Stuart K. Grange

Examples

## Not run: 

# Code urban area population into defined groups
data_join <- left_join_range(
  data_urban, 
  data_urban_class, 
  "population", 
  "size_min", 
  "size_max"
 )


## End(Not run)


skgrange/threadr documentation built on May 11, 2024, 12:16 p.m.