choose_names: Choose columns to keep from a dataframe, based on a data map

View source: R/choose_names.R

choose_namesR Documentation

Choose columns to keep from a dataframe, based on a data map

Description

The behaviour when df provided and is.null(data_map) is essentially df <- df (although any colnames matching excludes will be removed)

Usage

choose_names(
  df = NULL,
  data_map = NULL,
  this_name,
  excludes = NULL,
  final_select = FALSE,
  final_select_col = "bio_all"
)

Arguments

df

Dataframe to select columns from. Only needed if is.null(data_map)

data_map

Dataframe or NULL. Mapping of fields to retrieve. See example envImport::data_map or envImport::data_map_old. If NULL all columns are returned. Optional if df provided.

this_name

Character. data_name value in data_map. Required if data_map is not NULL

final_select

Logical. Is this the final select prior to writing to disk?

final_select_col

Character. If final_select, which column contains the logical values to filter on?


Acanthiza/envImport documentation built on Aug. 14, 2024, 8:18 a.m.