Skip to contents

This is only approximate, and there are even software packages which can give false negatives and be identified as prose (like rOpenSci's "geonames" package), and prose which may be wrongly identified as code.

Usage

text_is_code(txt)

Arguments

txt

Single input text string

Value

Logical value indicating whether or not txt was identified as code.

Examples

txt <- "Some text without any code"
text_is_code (txt)
#> [1] FALSE
txt <- "this_is_code <- function (x) { x }"
text_is_code (txt)
#> [1] TRUE