dputactually records the output where it was expected, but does not write it when it is expected. Executing the following code shows that the output dputremains pending until the next normal output:
sink(file = 'test.txt', split = TRUE)
x <- 2^(1:4)
x
dput(2*x,file="")
3*x
... gives test.txt with:
[1] 2 4 8 16
c(4, 8, 16, 32)
[1] 6 12 24 48
sink() ( ).
sink(file = 'test.txt', split = TRUE)
x <- 2^(1:4)
x
dput(2*x,file="")
sink()