print_function_contents: Print a function with numbered lines.

Description Usage Arguments Details

View source: R/print_function_contents.R

Description

Many checkr statements will be packaged into functions with just one input: USER_CODE. In narrative documentation for checkr, it can be nice to print these with lines numbered, so that the narrative can refer to them. There's no reason to use this function in a learnr tutorial, unless that tutorial is about checkr itself.

Usage

1
print_function_contents(fun, just_the_body = TRUE, from_file = NULL)

Arguments

fun

Name of the function, e.g. lm.

just_the_body

If TRUE, show just the body of the function. Otherwise, include the function definition.

from_file

name of a .R file. If the function resides in a .R file, giving from_file will cause that .R file to be sourced.

Details

Won't work for primitives, but then you'll never be writing primitives.


dtkaplan/checkr2 documentation built on May 17, 2019, 4:01 p.m.