From 709195b9c29ea297114928ebf23d78a9141404c8 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Sun, 22 Sep 2024 20:32:39 -0700 Subject: [PATCH] combine blocks --- vignettes/datatable-reference-semantics.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/datatable-reference-semantics.Rmd b/vignettes/datatable-reference-semantics.Rmd index fb829fdf9..170783165 100644 --- a/vignettes/datatable-reference-semantics.Rmd +++ b/vignettes/datatable-reference-semantics.Rmd @@ -68,7 +68,7 @@ DF$c <- 18:13 # (1) -- replace entire column DF$c[DF$ID == "b"] <- 15:13 # (2) -- subassign in column 'c' ``` -both (1) and (2) resulted in deep copy of the entire data.frame in versions of `R` `< 3.1`. [It copied more than once](https://stackoverflow.com/q/23898969/559784). To improve performance by avoiding these redundant copies, *data.table* utilised the [available but unused `:=` operator in R](https://stackoverflow.com/q/7033106/559784). +both (1) and (2) resulted in deep copy of the entire data.frame in versions of `R < 3.1`. [It copied more than once](https://stackoverflow.com/q/23898969/559784). To improve performance by avoiding these redundant copies, *data.table* utilised the [available but unused `:=` operator in R](https://stackoverflow.com/q/7033106/559784). Great performance improvements were made in `R v3.1` as a result of which only a *shallow* copy is made for (1) and not *deep* copy. However, for (2) still, the entire column is *deep* copied even in `R v3.1+`. This means the more columns one subassigns to in the *same query*, the more *deep* copies R does.