container_weights: Creates a weight by postcode for each major port

View source: R/container_weights.R

container_weightsR Documentation

Creates a weight by postcode for each major port

Description

Creates a weight by postcode for each major port.

Usage

container_weights(
  path,
  sheet_nums,
  range = "A7:M2217",
  postcode_shp,
  na = c("", "-", "np"),
  outfile,
  return_sf = FALSE
)

Arguments

path

Character. File path to xls file containing containers by postcode for each port.

sheet_nums

Integer. Vector of integers signifying the sheet numbers to read in.

range

A cell range to read from, as described in cell-specification. Includes typical Excel ranges such as "B3:D87", possibly including the sheet name like "Budget!B2:G14", and more. Interpreted strictly, even if the range forces the inclusion of leading or trailing empty rows or columns.

postcode_shp

Character. File path to postcode shape file.

na

Character vector of strings to interpret as missing values. By default, readxl treats blank cells as missing data.

outfile

Character. Name of shapefile where output will be saved. If not provided, sf object will be returned to R.

return_sf

Logical. Should the sf object be returned to R? Ignored if outfile is not provided.

Details

For the purposes of this analysis missing data (i.e. NAs) will be treated as zeroes.

Value

An sf object or shapefile export.


jscamac/edmaps documentation built on June 11, 2022, 1:26 a.m.