Learn R Programming

litedown (version 0.7)

timing_data: Get the timing data of code chunks and text blocks in a document

Description

Timing can be enabled via the chunk option time = TRUE (e.g., set reactor(time = TRUE) in the first code chunk). After it is enabled, the execution time for code chunks and text blocks will be recorded. This function can be called to retrieve the timing data later in the document (e.g., in the last code chunk).

Usage

timing_data(threshold = 0, sort = TRUE, total = TRUE)

Value

A data frame containing input file paths, line numbers, chunk labels, and time. If no timing data is available, NULL is returned.

Arguments

threshold

A number (time in seconds) to subset data with. Only rows with time above this threshold are returned.

sort

Whether to sort the data by time in the decreasing order.

total

Whether to append the total time to the data.