[Deprecated]

This is useful for understand how and when dplyr makes copies of data frames

location(df)

changes(x, y)

Arguments

df

a data frame

x, y

two data frames to compare

Examples

location(mtcars)
#> Warning: `location()` was deprecated in dplyr 1.0.0.
#> Please use `lobst::ref()` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_warnings()` to see where this warning was generated.
#> <0x7fc2419ba578>
#> Variables:
#>  * mpg:       <0x7fc23b350110>
#>  * cyl:       <0x7fc23b3571a0>
#>  * disp:      <0x7fc23b3572d0>
#>  * hp:        <0x7fc23b357400>
#>  * drat:      <0x7fc23b357b10>
#>  * wt:        <0x7fc23b357c40>
#>  * qsec:      <0x7fc23b357d70>
#>  * vs:        <0x7fc23b357ea0>
#>  * am:        <0x7fc23b357fd0>
#>  * gear:      <0x7fc23b358100>
#>  * carb:      <0x7fc23b358230>
#> Attributes:
#>  * names:     <0x7fc2419ba4c8>
#>  * row.names: <0x7fc23b33cb70>
#>  * class:     <0x7fc23cf921c0>
# ->
lobstr::ref(mtcars)
#>  [1:0x7fc2419ba578] <df[,11]> 
#> ├─mpg = [2:0x7fc23b350110] <dbl> 
#> ├─cyl = [3:0x7fc23b3571a0] <dbl> 
#> ├─disp = [4:0x7fc23b3572d0] <dbl> 
#> ├─hp = [5:0x7fc23b357400] <dbl> 
#> ├─drat = [6:0x7fc23b357b10] <dbl> 
#> ├─wt = [7:0x7fc23b357c40] <dbl> 
#> ├─qsec = [8:0x7fc23b357d70] <dbl> 
#> ├─vs = [9:0x7fc23b357ea0] <dbl> 
#> ├─am = [10:0x7fc23b357fd0] <dbl> 
#> ├─gear = [11:0x7fc23b358100] <dbl> 
#> └─carb = [12:0x7fc23b358230] <dbl> 

mtcars2 <- mutate(mtcars, cyl2 = cyl * 2)
# ->
lobstr::ref(mtcars2)
#>  [1:0x7fc23d857a98] <df[,12]> 
#> ├─mpg = [2:0x7fc23b350110] <dbl> 
#> ├─cyl = [3:0x7fc23b3571a0] <dbl> 
#> ├─disp = [4:0x7fc23b3572d0] <dbl> 
#> ├─hp = [5:0x7fc23b357400] <dbl> 
#> ├─drat = [6:0x7fc23b357b10] <dbl> 
#> ├─wt = [7:0x7fc23b357c40] <dbl> 
#> ├─qsec = [8:0x7fc23b357d70] <dbl> 
#> ├─vs = [9:0x7fc23b357ea0] <dbl> 
#> ├─am = [10:0x7fc23b357fd0] <dbl> 
#> ├─gear = [11:0x7fc23b358100] <dbl> 
#> ├─carb = [12:0x7fc23b358230] <dbl> 
#> └─cyl2 = [13:0x7fc23b375cf0] <dbl> 

changes(mtcars, mtcars2)
#> Warning: `changes()` was deprecated in dplyr 1.0.0.
#> Please use `lobstr::ref()` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_warnings()` to see where this warning was generated.
#> Changed variables:
#>       old     new           
#> cyl2  <added> 0x7fc23b375cf0
#> 
#> Changed attributes:
#>       old            new           
#> names 0x7fc2419ba4c8 0x7fc23c43fc98
# ->
lobstr::ref(mtcars, mtcars2)
#>  [1:0x7fc2419ba578] <df[,11]> 
#> ├─mpg = [2:0x7fc23b350110] <dbl> 
#> ├─cyl = [3:0x7fc23b3571a0] <dbl> 
#> ├─disp = [4:0x7fc23b3572d0] <dbl> 
#> ├─hp = [5:0x7fc23b357400] <dbl> 
#> ├─drat = [6:0x7fc23b357b10] <dbl> 
#> ├─wt = [7:0x7fc23b357c40] <dbl> 
#> ├─qsec = [8:0x7fc23b357d70] <dbl> 
#> ├─vs = [9:0x7fc23b357ea0] <dbl> 
#> ├─am = [10:0x7fc23b357fd0] <dbl> 
#> ├─gear = [11:0x7fc23b358100] <dbl> 
#> └─carb = [12:0x7fc23b358230] <dbl> 
#>  
#>  [13:0x7fc23d857a98] <df[,12]> 
#> ├─mpg = [2:0x7fc23b350110] 
#> ├─cyl = [3:0x7fc23b3571a0] 
#> ├─disp = [4:0x7fc23b3572d0] 
#> ├─hp = [5:0x7fc23b357400] 
#> ├─drat = [6:0x7fc23b357b10] 
#> ├─wt = [7:0x7fc23b357c40] 
#> ├─qsec = [8:0x7fc23b357d70] 
#> ├─vs = [9:0x7fc23b357ea0] 
#> ├─am = [10:0x7fc23b357fd0] 
#> ├─gear = [11:0x7fc23b358100] 
#> ├─carb = [12:0x7fc23b358230] 
#> └─cyl2 = [14:0x7fc23b375cf0] <dbl>