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.
See also
Other utils:
head.pkgmatch()
,
pkgmatch_browse()
,
pkgmatch_load_data()
,
print.pkgmatch()