Data Frames
- Data frames are lists of vectors
- So copying and modifying a column only affects that column
- BUT if you modify a row, every column must be copied
Only the modified column changes
d2[, 2] <- d2[, 2] * 2
ref(d1, d2)
#> █ [1:0x560e52195088] <df[,2]>
#> ├─x = [2:0x560e513fe918] <dbl>
#> └─y = [3:0x560e513fe968] <dbl>
#>
#> █ [4:0x560e51dfbca8] <df[,2]>
#> ├─x = [2:0x560e513fe918]
#> └─y = [5:0x560e51377178] <dbl>
All columns change