merge_datasets: Improved dataset merger function

merge_datasetsR Documentation

Improved dataset merger function

Description

This function allows you to merge two data.frames by their overlapping rownames. About 15 times faster than the earlier version.

Usage

merge_datasets(
  DF1,
  DF2,
  join = "both",
  overwrite_NA = FALSE,
  restore_factors = FALSE
)

Arguments

DF1

(data.frame) A data.frame to merge into.

DF2

(data.frame) A data.frame with the new data.

join

(character scalar) Which data.frame to use cases from. Options: left, right, both.

overwrite_NA

(lgl scalar) Whether to overwrite with NA values.

restore_factors

(lgl scalar) Whether to recreate factors in the merged data.frame. Does not keep levels.

Examples

merge_datasets(iris[1:4], iris[1:5]) #merge together two parts of iris

Deleetdk/kirkegaard documentation built on April 22, 2024, 5:22 p.m.