Cloning ffdf objects
clone.ffdf.rdclone physically duplicates ffdf objects
Details
Creates a deep copy of an ffdf object by cloning all physical components including the row.names
Value
An object of type ffdf
Examples
x <- as.ffdf(data.frame(a=1:26, b=letters, stringsAsFactors = TRUE))
message("Here we change the content of both x and y by reference")
#> Here we change the content of both x and y by reference
y <- x
x$a[1] <- -1
y$a[1]
#> [1] -1
message("Here we change the content only of x because y is a deep copy")
#> Here we change the content only of x because y is a deep copy
y <- clone(x)
x$a[2] <- -2
y$a[2]
#> [1] 2
rm(x, y); gc()
#> used (Mb) gc trigger (Mb) max used (Mb)
#> Ncells 1225666 65.5 2239654 119.7 2239654 119.7
#> Vcells 2245390 17.2 8388608 64.0 5871749 44.8