Skip to contents

[Deprecated] Chunks are being deprecated qenv objects should be used instead

Usage

chunks_push_chunks(x, overwrite = FALSE, chunks = get_chunks_object())

Arguments

x

(chunks) stack object

overwrite

optional, (logical) Whether to ignore conflicts between the two chunk environments and use the added one as default

chunks

optional, (chunks) object. If not provided then automatic chunks object detection is run via get_chunks_object

Value

Nothing, just add the chunk to the chunks argument

Examples

chunks_object <- chunks_new()
chunks_push(chunks = chunks_object, expression = bquote(x <- 1))

chunks_object2 <- chunks_new()
chunks_push(chunks = chunks_object2, expression = bquote(y <- 1))

chunks_push_chunks(chunks = chunks_object, x = chunks_object2)

chunks_get_rcode(chunks_object)
#>       chunk_1 chunk_1_XDGRL 
#>      "x <- 1"      "y <- 1"