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)
#> <0x833f788> #> Variables: #> * mpg: <0x183f410> #> * cyl: <0x183f550> #> * disp: <0x183f690> #> * hp: <0x8062d20> #> * drat: <0x8062e60> #> * wt: <0x8062fa0> #> * qsec: <0x80630e0> #> * vs: <0x8063220> #> * am: <0x8063360> #> * gear: <0x80634a0> #> * carb: <0x80635e0> #> Attributes: #> * names: <0x833f6d8> #> * row.names: <0x8063720> #> * class: <0x6f45750>
mtcars2 <- mutate(mtcars, cyl2 = cyl * 2) location(mtcars2)
#> <0x91cd1f8> #> Variables: #> * mpg: <0x183f410> #> * cyl: <0x183f550> #> * disp: <0x183f690> #> * hp: <0x8062d20> #> * drat: <0x8062e60> #> * wt: <0x8062fa0> #> * qsec: <0x80630e0> #> * vs: <0x8063220> #> * am: <0x8063360> #> * gear: <0x80634a0> #> * carb: <0x80635e0> #> * cyl2: <0x6988ec0> #> Attributes: #> * names: <0x91cd098> #> * class: <0x6fad878> #> * row.names: <0x2b9aea8>
changes(mtcars, mtcars)
#> <identical>
changes(mtcars, mtcars2)
#> Changed variables: #> old new #> cyl2 <added> 0x6988ec0 #> #> Changed attributes: #> old new #> names 0x833f6d8 0x91cd098 #> row.names 0x8063720 0xe3e3838 #> class 0x6f45750 0x6fad878