add_lookups: Add values from a lookup file stored in S3 to a dataset

View source: R/add_lookups.R

add_lookupsR Documentation

Add values from a lookup file stored in S3 to a dataset

Description

Takes a vector of lookup files stored as CSVs in S3 and matches them to a data frame by a corresponding vector of variables. The file and variable names must be in the same position in their respective vectors and both vectors must be the same length.

Usage

add_lookups(data, path, vars)

Arguments

data

Data frame the lookups are to be added to.

path

A character vector of paths to lookup files in S3.

vars

A character vector of variables by which to join the lookups to the data.

Examples

## Not run: 
add_lookups(mydata,"alpha-test-data/lookup-file.csv","regionname")
# joins lookup-file.csv to mydata by variable "regionname".

## End(Not run)

moj-analytical-services/mojrap documentation built on July 30, 2023, 4:43 p.m.