overwrite: Replace rows in a data frame with new values

Description Usage Arguments Value Author(s) Examples

View source: R/overwrite.R

Description

overwrite() rbind()s the data frames lhs and rhs, removing any duplicate lines, which are determined without regard to the columns in except.

Usage

1
overwrite(lhs, rhs, except = "value")

Arguments

lhs

data frame with values that will replace others

rhs

data frame with values that will be replaced

except

names of columns that will not be considered in determining which columns to replace; defaults to "value"

Value

data frame in which rows from rhs have been replaced with rows from lhs

Author(s)

Michaja Pehl

Examples

1
2
3
4
5
6
7
8
9
require(dplyr)
data <- data.frame(expand.grid(UPPER = LETTERS[1:2],
                               lower = letters[24:26]),
                   value = 1:6)
data
data %>%
  filter(lower == "y") %>%
  mutate(value = value * 10) %>%
  overwrite(data)

michaja/quitte documentation built on May 22, 2019, 9:53 p.m.