copy | R Documentation |
Mainly intended to copy data.table objects because by default they are modified by reference. See example.
copy(x)
x |
object |
copy of the object 'x'
data(mtcars)
dt_mtcars = as.data.table(mtcars)
dt_mtcars2 = dt_mtcars
dt_mtcars3 = copy(dt_mtcars)
let(dt_mtcars, new = 1)
head(dt_mtcars2) # we see 'new' column
head(dt_mtcars3) # no 'new' column
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.