Displaying 1 result from an estimated 1 matches for "bd7acf0".
2013 Jan 24
1
Copy on assignment and .Internal(inspect())
...f it's ok to use .Internal(inspect(x)) in order
to detect vector copying.
Take for example the following silly code:
f <- function() {
x = seq(10)
print(.Internal(inspect(x)))
for(i in seq(10)) {
x[i] <- x[i] + 1
print(.Internal(inspect(x)))
}
}
The output of f() was:
@bd7acf0 13 INTSXP g0c4 [NAM(1)] (len=10, tl=0) 1,2,3,4,5,...
[1] 1 2 3 4 5 6 7 8 9 10
@bdd6f80 14 REALSXP g0c6 [NAM(1)] (len=10, tl=0) 2,2,3,4,5,...
[1] 2 2 3 4 5 6 7 8 9 10
@ba66278 14 REALSXP g0c6 [NAM(1)] (len=10, tl=0) 2,3,3,4,5,...
[1] 2 3 3 4 5 6 7 8 9 10
@ba661e0 14 REA...