Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uptaded documentation on rows_append and rows_insert, issue #6864 #6942

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions R/rows.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
#' `in_place` for selected backends.
#'
#' * `rows_insert()` adds new rows (like `INSERT`). By default, key values in
#' `y` must not exist in `x`.
#' * `rows_append()` works like `rows_insert()` but ignores keys.
#' `y` must not exist in `x`. Adds rows to a dataset without overwriting existing
# rows or introducing complete duplicates based on key columns.
#' * `rows_append()` works like `rows_insert()` but ignores keys.
# Attaches new rows to the end of a dataset without any checks for duplicates.
#' * `rows_update()` modifies existing rows (like `UPDATE`). Key values in `y`
#' must be unique, and, by default, key values in `y` must exist in `x`.
#' * `rows_patch()` works like `rows_update()` but only overwrites `NA` values.
Expand Down Expand Up @@ -91,10 +93,11 @@
#' # and will throw an error. Alternatively, you can ignore rows in `y`
#' # containing keys that conflict with keys in `x` with `conflict = "ignore"`,
#' # or you can use `rows_append()` to ignore keys entirely.
#' # For instance, if you're adding a customer record and don't want to insert a new row if a customer with the same ID already exists, choose this function.
#' try(rows_insert(data, tibble(a = 3, b = "z")))
#' rows_insert(data, tibble(a = 3, b = "z"), conflict = "ignore")
#' rows_append(data, tibble(a = 3, b = "z"))
#'
#'If you're merging datasets and aren't concerned about potential overlaps or repeated rows, this function is ideal.
#' # Update
#' rows_update(data, tibble(a = 2:3, b = "z"))
#' rows_update(data, tibble(b = "z", a = 2:3), by = "a")
Expand Down