From 6861b999fdea0eeaef7080f3dab05e15f343cac6 Mon Sep 17 00:00:00 2001 From: Tomasz Kalinowski Date: Mon, 13 Nov 2017 10:39:13 -0500 Subject: [PATCH 01/12] Add modify methods for integer, double, and character --- NAMESPACE | 9 ++++++++ R/modify.R | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++- man/modify.Rd | 31 ++++++++++++++++++++++++- 3 files changed, 102 insertions(+), 2 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 1c5a8a21..c2713304 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -4,11 +4,20 @@ S3method(as_mapper,character) S3method(as_mapper,default) S3method(as_mapper,list) S3method(as_mapper,numeric) +S3method(modify,character) S3method(modify,default) +S3method(modify,double) +S3method(modify,integer) S3method(modify,pairlist) +S3method(modify_at,character) S3method(modify_at,default) +S3method(modify_at,double) +S3method(modify_at,integer) S3method(modify_depth,default) +S3method(modify_if,character) S3method(modify_if,default) +S3method(modify_if,double) +S3method(modify_if,integer) export("%>%") export("%@%") export("%||%") diff --git a/R/modify.R b/R/modify.R index d655c6fc..6ccf4865 100644 --- a/R/modify.R +++ b/R/modify.R @@ -16,7 +16,9 @@ #' #' All these functions are S3 generic. However, the default method is #' sufficient in many cases. It should be suitable for any data type -#' that implements the subset-assignment method `[<-`. +#' that implements the subset-assignment method `[<-`. Methods are provided +#' for character, integer and double, (counterparts to `map_int`, `map_dbl` +#' and `map_chr`) #' #' In some cases it may make sense to provide a custom implementation #' with a method suited to your S3 class. For example, a `grouped_df` @@ -87,6 +89,24 @@ modify.default <- function(.x, .f, ...) { .x[] <- map(.x, .f, ...) .x } +#' @rdname modify +#' @export +modify.integer <- function (.x, .f, ...) { + .x[] <- map_int(.x, .f, ...) + .x +} +#' @rdname modify +#' @export +modify.double <- function (.x, .f, ...) { + .x[] <- map_dbl(.x, .f, ...) + .x +} +#' @rdname modify +#' @export +modify.character <- function (.x, .f, ...) { + .x[] <- map_chr(.x, .f, ...) + .x +} #' @export modify.pairlist <- function(.x, .f, ...) { @@ -106,6 +126,27 @@ modify_if.default <- function(.x, .p, .f, ...) { .x[sel] <- map(.x[sel], .f, ...) .x } +#' @rdname modify +#' @export +modify_if.integer <- function(.x, .p, .f, ...) { + sel <- probe(.x, .p) + .x[sel] <- map_int(.x[sel], .f, ...) + .x +} +#' @rdname modify +#' @export +modify_if.double <- function(.x, .p, .f, ...) { + sel <- probe(.x, .p) + .x[sel] <- map_dbl(.x[sel], .f, ...) + .x +} +#' @rdname modify +#' @export +modify_if.character <- function(.x, .p, .f, ...) { + sel <- probe(.x, .p) + .x[sel] <- map_chr(.x[sel], .f, ...) + .x +} #' @rdname modify #' @export @@ -119,6 +160,27 @@ modify_at.default <- function(.x, .at, .f, ...) { .x[sel] <- map(.x[sel], .f, ...) .x } +#' @rdname modify +#' @export +modify_at.integer <- function(.x, .at, .f, ...) { + sel <- inv_which(.x, .at) + .x[sel] <- map_int(.x[sel], .f, ...) + .x +} +#' @rdname modify +#' @export +modify_at.double <- function(.x, .at, .f, ...) { + sel <- inv_which(.x, .at) + .x[sel] <- map_dbl(.x[sel], .f, ...) + .x +} +#' @rdname modify +#' @export +modify_at.character <- function(.x, .at, .f, ...) { + sel <- inv_which(.x, .at) + .x[sel] <- map_chr(.x[sel], .f, ...) + .x +} #' @rdname modify #' @export diff --git a/man/modify.Rd b/man/modify.Rd index 9ab343a7..77231185 100644 --- a/man/modify.Rd +++ b/man/modify.Rd @@ -3,10 +3,19 @@ \name{modify} \alias{modify} \alias{modify.default} +\alias{modify.integer} +\alias{modify.double} +\alias{modify.character} \alias{modify_if} \alias{modify_if.default} +\alias{modify_if.integer} +\alias{modify_if.double} +\alias{modify_if.character} \alias{modify_at} \alias{modify_at.default} +\alias{modify_at.integer} +\alias{modify_at.double} +\alias{modify_at.character} \alias{modify_depth} \alias{modify_depth.default} \alias{at_depth} @@ -16,14 +25,32 @@ modify(.x, .f, ...) \method{modify}{default}(.x, .f, ...) +\method{modify}{integer}(.x, .f, ...) + +\method{modify}{double}(.x, .f, ...) + +\method{modify}{character}(.x, .f, ...) + modify_if(.x, .p, .f, ...) \method{modify_if}{default}(.x, .p, .f, ...) +\method{modify_if}{integer}(.x, .p, .f, ...) + +\method{modify_if}{double}(.x, .p, .f, ...) + +\method{modify_if}{character}(.x, .p, .f, ...) + modify_at(.x, .at, .f, ...) \method{modify_at}{default}(.x, .at, .f, ...) +\method{modify_at}{integer}(.x, .at, .f, ...) + +\method{modify_at}{double}(.x, .at, .f, ...) + +\method{modify_at}{character}(.x, .at, .f, ...) + modify_depth(.x, .depth, .f, ..., .ragged = .depth < 0) \method{modify_depth}{default}(.x, .depth, .f, ..., .ragged = .depth < 0) @@ -98,7 +125,9 @@ must preserve the length of the input. All these functions are S3 generic. However, the default method is sufficient in many cases. It should be suitable for any data type -that implements the subset-assignment method \code{[<-}. +that implements the subset-assignment method \code{[<-}. Methods are provided +for character, integer and double, (counterparts to \code{map_int}, \code{map_dbl} +and \code{map_chr}) In some cases it may make sense to provide a custom implementation with a method suited to your S3 class. For example, a \code{grouped_df} From a94e5b4fad0a49bafcab6dd57c872b2a725257a0 Mon Sep 17 00:00:00 2001 From: Tomasz Kalinowski Date: Mon, 5 Feb 2018 23:10:18 -0500 Subject: [PATCH 02/12] add modify.logical() --- R/modify.R | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/R/modify.R b/R/modify.R index 6ccf4865..b7ef2442 100644 --- a/R/modify.R +++ b/R/modify.R @@ -107,7 +107,12 @@ modify.character <- function (.x, .f, ...) { .x[] <- map_chr(.x, .f, ...) .x } - +#' @rdname modify +#' @export +modify.logical <- function (.x, .f, ...) { + .x[] <- map_lgl(.x, .f, ...) + .x +} #' @export modify.pairlist <- function(.x, .f, ...) { as.pairlist(map(.x, .f, ...)) From a1208bc77a05962f160d18af2f79208ad3b4eca8 Mon Sep 17 00:00:00 2001 From: Tomasz Kalinowski Date: Mon, 5 Feb 2018 23:10:35 -0500 Subject: [PATCH 03/12] add tests for modify() --- tests/testthat/test-modify.R | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/testthat/test-modify.R b/tests/testthat/test-modify.R index b57e6f84..a9e3dbd6 100644 --- a/tests/testthat/test-modify.R +++ b/tests/testthat/test-modify.R @@ -40,6 +40,13 @@ test_that("modify works with calls and pairlists", { expect_equal(out, pairlist(2, 3)) }) +test_that("modify preserves atomic vector classes", { + expect_type(modify("a", identity), "character") + expect_type(modify(1L, identity), "integer") + expect_type(modify(1, identity), "double") + expect_type(modify(TRUE, identity), "logical") +}) + # modify_depth ------------------------------------------------------------ test_that("modify_depth modifies values at specified depth", { From dffc9a260b30f41fff2479fd12715ae683e8511c Mon Sep 17 00:00:00 2001 From: Tomasz Kalinowski Date: Mon, 5 Feb 2018 23:15:52 -0500 Subject: [PATCH 04/12] update modify documentation --- R/modify.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/modify.R b/R/modify.R index b7ef2442..37d0cc4f 100644 --- a/R/modify.R +++ b/R/modify.R @@ -17,8 +17,8 @@ #' All these functions are S3 generic. However, the default method is #' sufficient in many cases. It should be suitable for any data type #' that implements the subset-assignment method `[<-`. Methods are provided -#' for character, integer and double, (counterparts to `map_int`, `map_dbl` -#' and `map_chr`) +#' for character, logical, integer and double classes (counterparts to `map_chr`, +#' `map_lgl`, `map_int`, and `map_dbl`) #' #' In some cases it may make sense to provide a custom implementation #' with a method suited to your S3 class. For example, a `grouped_df` From 475a72afb5734593afb4822e52060b91d6bf53a5 Mon Sep 17 00:00:00 2001 From: Tomasz Kalinowski Date: Tue, 6 Feb 2018 19:19:11 -0500 Subject: [PATCH 05/12] add logical method for modify_if, modify_at --- NAMESPACE | 2 ++ R/modify.R | 14 ++++++++++++++ man/modify.Rd | 10 ++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index c2713304..b15c87fc 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -13,11 +13,13 @@ S3method(modify_at,character) S3method(modify_at,default) S3method(modify_at,double) S3method(modify_at,integer) +S3method(modify_at,logical) S3method(modify_depth,default) S3method(modify_if,character) S3method(modify_if,default) S3method(modify_if,double) S3method(modify_if,integer) +S3method(modify_if,logical) export("%>%") export("%@%") export("%||%") diff --git a/R/modify.R b/R/modify.R index 37d0cc4f..78d7f6d7 100644 --- a/R/modify.R +++ b/R/modify.R @@ -152,6 +152,13 @@ modify_if.character <- function(.x, .p, .f, ...) { .x[sel] <- map_chr(.x[sel], .f, ...) .x } +#' @rdname modify +#' @export +modify_if.logical <- function(.x, .p, .f, ...) { + sel <- probe(.x, .p) + .x[sel] <- map_lgl(.x[sel], .f, ...) + .x +} #' @rdname modify #' @export @@ -186,6 +193,13 @@ modify_at.character <- function(.x, .at, .f, ...) { .x[sel] <- map_chr(.x[sel], .f, ...) .x } +#' @rdname modify +#' @export +modify_at.logical <- function(.x, .at, .f, ...) { + sel <- inv_which(.x, .at) + .x[sel] <- map_lgl(.x[sel], .f, ...) + .x +} #' @rdname modify #' @export diff --git a/man/modify.Rd b/man/modify.Rd index 77231185..7743863b 100644 --- a/man/modify.Rd +++ b/man/modify.Rd @@ -11,11 +11,13 @@ \alias{modify_if.integer} \alias{modify_if.double} \alias{modify_if.character} +\alias{modify_if.logical} \alias{modify_at} \alias{modify_at.default} \alias{modify_at.integer} \alias{modify_at.double} \alias{modify_at.character} +\alias{modify_at.logical} \alias{modify_depth} \alias{modify_depth.default} \alias{at_depth} @@ -41,6 +43,8 @@ modify_if(.x, .p, .f, ...) \method{modify_if}{character}(.x, .p, .f, ...) +\method{modify_if}{logical}(.x, .p, .f, ...) + modify_at(.x, .at, .f, ...) \method{modify_at}{default}(.x, .at, .f, ...) @@ -51,6 +55,8 @@ modify_at(.x, .at, .f, ...) \method{modify_at}{character}(.x, .at, .f, ...) +\method{modify_at}{logical}(.x, .at, .f, ...) + modify_depth(.x, .depth, .f, ..., .ragged = .depth < 0) \method{modify_depth}{default}(.x, .depth, .f, ..., .ragged = .depth < 0) @@ -126,8 +132,8 @@ must preserve the length of the input. All these functions are S3 generic. However, the default method is sufficient in many cases. It should be suitable for any data type that implements the subset-assignment method \code{[<-}. Methods are provided -for character, integer and double, (counterparts to \code{map_int}, \code{map_dbl} -and \code{map_chr}) +for character, logical, integer and double classes (counterparts to \code{map_chr}, +\code{map_lgl}, \code{map_int}, and \code{map_dbl}) In some cases it may make sense to provide a custom implementation with a method suited to your S3 class. For example, a \code{grouped_df} From fb927d4ad0e95c53f69e58b4de23c61f8084bb89 Mon Sep 17 00:00:00 2001 From: Tomasz Kalinowski Date: Tue, 6 Feb 2018 19:19:28 -0500 Subject: [PATCH 06/12] add tests for modify_if, modify_at --- tests/testthat/test-modify.R | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/testthat/test-modify.R b/tests/testthat/test-modify.R index a9e3dbd6..12e17d47 100644 --- a/tests/testthat/test-modify.R +++ b/tests/testthat/test-modify.R @@ -40,11 +40,21 @@ test_that("modify works with calls and pairlists", { expect_equal(out, pairlist(2, 3)) }) -test_that("modify preserves atomic vector classes", { +test_that("modify{,_at,_if} preserves atomic vector classes", { expect_type(modify("a", identity), "character") expect_type(modify(1L, identity), "integer") expect_type(modify(1, identity), "double") expect_type(modify(TRUE, identity), "logical") + + expect_type(modify_at("a", 1L, identity), "character") + expect_type(modify_at(1L, 1L, identity), "integer") + expect_type(modify_at(1, 1L, identity), "double") + expect_type(modify_at(TRUE, 1L, identity), "logical") + + expect_type(modify_if("a", TRUE, identity), "character") + expect_type(modify_if(1L, TRUE, identity), "integer") + expect_type(modify_if(1, TRUE, identity), "double") + expect_type(modify_if(TRUE, TRUE, identity), "logical") }) # modify_depth ------------------------------------------------------------ From bf156529d719aed6308a506d745bac237b7500b4 Mon Sep 17 00:00:00 2001 From: Tomasz Kalinowski Date: Tue, 6 Feb 2018 19:19:56 -0500 Subject: [PATCH 07/12] temporarily skip failing tests --- tests/testthat/test-as-mapper.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/testthat/test-as-mapper.R b/tests/testthat/test-as-mapper.R index 7cfcf1e3..6dfd5943 100644 --- a/tests/testthat/test-as-mapper.R +++ b/tests/testthat/test-as-mapper.R @@ -21,6 +21,7 @@ test_that("can refer to second arg in two ways", { # }) test_that(".default replaces absent values", { + skip("as_mapper() WIP") x <- list( list(a = 1, b = 2, c = 3), list(a = 1, c = 2), @@ -32,6 +33,7 @@ test_that(".default replaces absent values", { }) test_that(".default replaces elements with length 0", { + skip("as_mapper() WIP") x <- list( list(a = 1), list(a = NULL), From 6fe072d6e0b7e92e02d89930ff6aaa4f16940b4c Mon Sep 17 00:00:00 2001 From: Tomasz Kalinowski <> Date: Thu, 8 Feb 2018 18:38:14 -0500 Subject: [PATCH 08/12] test as_mapper() again --- tests/testthat/test-as-mapper.R | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/testthat/test-as-mapper.R b/tests/testthat/test-as-mapper.R index 6dfd5943..7cfcf1e3 100644 --- a/tests/testthat/test-as-mapper.R +++ b/tests/testthat/test-as-mapper.R @@ -21,7 +21,6 @@ test_that("can refer to second arg in two ways", { # }) test_that(".default replaces absent values", { - skip("as_mapper() WIP") x <- list( list(a = 1, b = 2, c = 3), list(a = 1, c = 2), @@ -33,7 +32,6 @@ test_that(".default replaces absent values", { }) test_that(".default replaces elements with length 0", { - skip("as_mapper() WIP") x <- list( list(a = 1), list(a = NULL), From 0a2bda2652af6cb1a0d7956822f95d5af6ca3d6f Mon Sep 17 00:00:00 2001 From: Tomasz Kalinowski Date: Mon, 13 Nov 2017 10:39:13 -0500 Subject: [PATCH 09/12] Add modify methods for integer, double, and character --- NAMESPACE | 1 + R/modify.R | 1 + man/modify.Rd | 3 +++ 3 files changed, 5 insertions(+) diff --git a/NAMESPACE b/NAMESPACE index b15c87fc..2671c754 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -8,6 +8,7 @@ S3method(modify,character) S3method(modify,default) S3method(modify,double) S3method(modify,integer) +S3method(modify,logical) S3method(modify,pairlist) S3method(modify_at,character) S3method(modify_at,default) diff --git a/R/modify.R b/R/modify.R index 78d7f6d7..d76aaf60 100644 --- a/R/modify.R +++ b/R/modify.R @@ -113,6 +113,7 @@ modify.logical <- function (.x, .f, ...) { .x[] <- map_lgl(.x, .f, ...) .x } + #' @export modify.pairlist <- function(.x, .f, ...) { as.pairlist(map(.x, .f, ...)) diff --git a/man/modify.Rd b/man/modify.Rd index 7743863b..036e7d59 100644 --- a/man/modify.Rd +++ b/man/modify.Rd @@ -6,6 +6,7 @@ \alias{modify.integer} \alias{modify.double} \alias{modify.character} +\alias{modify.logical} \alias{modify_if} \alias{modify_if.default} \alias{modify_if.integer} @@ -33,6 +34,8 @@ modify(.x, .f, ...) \method{modify}{character}(.x, .f, ...) +\method{modify}{logical}(.x, .f, ...) + modify_if(.x, .p, .f, ...) \method{modify_if}{default}(.x, .p, .f, ...) From ca047b855eaaa4a1629136405d25d91ff2e5f3e1 Mon Sep 17 00:00:00 2001 From: Tomasz Kalinowski Date: Tue, 6 Feb 2018 19:19:56 -0500 Subject: [PATCH 10/12] temporarily skip failing tests --- tests/testthat/test-as-mapper.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/testthat/test-as-mapper.R b/tests/testthat/test-as-mapper.R index 7cfcf1e3..6dfd5943 100644 --- a/tests/testthat/test-as-mapper.R +++ b/tests/testthat/test-as-mapper.R @@ -21,6 +21,7 @@ test_that("can refer to second arg in two ways", { # }) test_that(".default replaces absent values", { + skip("as_mapper() WIP") x <- list( list(a = 1, b = 2, c = 3), list(a = 1, c = 2), @@ -32,6 +33,7 @@ test_that(".default replaces absent values", { }) test_that(".default replaces elements with length 0", { + skip("as_mapper() WIP") x <- list( list(a = 1), list(a = NULL), From 1ce1f3f5d18fd68a7cf3ea70f2c42eadf6238783 Mon Sep 17 00:00:00 2001 From: Tomasz Kalinowski <> Date: Thu, 8 Feb 2018 18:38:14 -0500 Subject: [PATCH 11/12] test as_mapper() again --- tests/testthat/test-as-mapper.R | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/testthat/test-as-mapper.R b/tests/testthat/test-as-mapper.R index 6dfd5943..7cfcf1e3 100644 --- a/tests/testthat/test-as-mapper.R +++ b/tests/testthat/test-as-mapper.R @@ -21,7 +21,6 @@ test_that("can refer to second arg in two ways", { # }) test_that(".default replaces absent values", { - skip("as_mapper() WIP") x <- list( list(a = 1, b = 2, c = 3), list(a = 1, c = 2), @@ -33,7 +32,6 @@ test_that(".default replaces absent values", { }) test_that(".default replaces elements with length 0", { - skip("as_mapper() WIP") x <- list( list(a = 1), list(a = NULL), From 8d58f7b515626649c12f34200d8e9ea13d266168 Mon Sep 17 00:00:00 2001 From: Tomasz Kalinowski Date: Sat, 10 Feb 2018 19:20:33 -0500 Subject: [PATCH 12/12] add news; tweak docs --- NEWS.md | 4 ++++ R/modify.R | 12 ------------ man/modify.Rd | 36 ------------------------------------ 3 files changed, 4 insertions(+), 48 deletions(-) diff --git a/NEWS.md b/NEWS.md index 0c42dab5..c7cd9544 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # purrr 0.2.4.9000 +* `modify()`, `modify_if()` and `modify_at()` now preserve the class of atomic + vectors instead of promoting them to lists. New S3 methods are provided for + character, logical, double, and integer classes (@t-kalinowski, #417). + * `attr_getter()` no longer uses partial matching. For example, if an `x` object has a `labels` attribute but no `label` attribute, `attr_getter("label")(x)` will no longer extract the `labels` diff --git a/R/modify.R b/R/modify.R index d76aaf60..af897d69 100644 --- a/R/modify.R +++ b/R/modify.R @@ -89,25 +89,21 @@ modify.default <- function(.x, .f, ...) { .x[] <- map(.x, .f, ...) .x } -#' @rdname modify #' @export modify.integer <- function (.x, .f, ...) { .x[] <- map_int(.x, .f, ...) .x } -#' @rdname modify #' @export modify.double <- function (.x, .f, ...) { .x[] <- map_dbl(.x, .f, ...) .x } -#' @rdname modify #' @export modify.character <- function (.x, .f, ...) { .x[] <- map_chr(.x, .f, ...) .x } -#' @rdname modify #' @export modify.logical <- function (.x, .f, ...) { .x[] <- map_lgl(.x, .f, ...) @@ -132,28 +128,24 @@ modify_if.default <- function(.x, .p, .f, ...) { .x[sel] <- map(.x[sel], .f, ...) .x } -#' @rdname modify #' @export modify_if.integer <- function(.x, .p, .f, ...) { sel <- probe(.x, .p) .x[sel] <- map_int(.x[sel], .f, ...) .x } -#' @rdname modify #' @export modify_if.double <- function(.x, .p, .f, ...) { sel <- probe(.x, .p) .x[sel] <- map_dbl(.x[sel], .f, ...) .x } -#' @rdname modify #' @export modify_if.character <- function(.x, .p, .f, ...) { sel <- probe(.x, .p) .x[sel] <- map_chr(.x[sel], .f, ...) .x } -#' @rdname modify #' @export modify_if.logical <- function(.x, .p, .f, ...) { sel <- probe(.x, .p) @@ -173,28 +165,24 @@ modify_at.default <- function(.x, .at, .f, ...) { .x[sel] <- map(.x[sel], .f, ...) .x } -#' @rdname modify #' @export modify_at.integer <- function(.x, .at, .f, ...) { sel <- inv_which(.x, .at) .x[sel] <- map_int(.x[sel], .f, ...) .x } -#' @rdname modify #' @export modify_at.double <- function(.x, .at, .f, ...) { sel <- inv_which(.x, .at) .x[sel] <- map_dbl(.x[sel], .f, ...) .x } -#' @rdname modify #' @export modify_at.character <- function(.x, .at, .f, ...) { sel <- inv_which(.x, .at) .x[sel] <- map_chr(.x[sel], .f, ...) .x } -#' @rdname modify #' @export modify_at.logical <- function(.x, .at, .f, ...) { sel <- inv_which(.x, .at) diff --git a/man/modify.Rd b/man/modify.Rd index 036e7d59..23c6a2dd 100644 --- a/man/modify.Rd +++ b/man/modify.Rd @@ -3,22 +3,10 @@ \name{modify} \alias{modify} \alias{modify.default} -\alias{modify.integer} -\alias{modify.double} -\alias{modify.character} -\alias{modify.logical} \alias{modify_if} \alias{modify_if.default} -\alias{modify_if.integer} -\alias{modify_if.double} -\alias{modify_if.character} -\alias{modify_if.logical} \alias{modify_at} \alias{modify_at.default} -\alias{modify_at.integer} -\alias{modify_at.double} -\alias{modify_at.character} -\alias{modify_at.logical} \alias{modify_depth} \alias{modify_depth.default} \alias{at_depth} @@ -28,38 +16,14 @@ modify(.x, .f, ...) \method{modify}{default}(.x, .f, ...) -\method{modify}{integer}(.x, .f, ...) - -\method{modify}{double}(.x, .f, ...) - -\method{modify}{character}(.x, .f, ...) - -\method{modify}{logical}(.x, .f, ...) - modify_if(.x, .p, .f, ...) \method{modify_if}{default}(.x, .p, .f, ...) -\method{modify_if}{integer}(.x, .p, .f, ...) - -\method{modify_if}{double}(.x, .p, .f, ...) - -\method{modify_if}{character}(.x, .p, .f, ...) - -\method{modify_if}{logical}(.x, .p, .f, ...) - modify_at(.x, .at, .f, ...) \method{modify_at}{default}(.x, .at, .f, ...) -\method{modify_at}{integer}(.x, .at, .f, ...) - -\method{modify_at}{double}(.x, .at, .f, ...) - -\method{modify_at}{character}(.x, .at, .f, ...) - -\method{modify_at}{logical}(.x, .at, .f, ...) - modify_depth(.x, .depth, .f, ..., .ragged = .depth < 0) \method{modify_depth}{default}(.x, .depth, .f, ..., .ragged = .depth < 0)