I created a package that with many functions that use a period to separate words. For example, I have functions named collapse.chapters()
, update.files()
, and create.title()
.
However, when I created the package, some are reported as S3methods (in NAMESPACE, S3method(collapse,chapters)
) while others are reported as generic functions (export(create.title)
). As a result, I can call create.title()
with no issue when the package is attached, but I cannot call collapse.chapters()
directly. If I call it directly, R returns,
Error: could not find function 'collapse.chapters',"
though I can call it using packagename:::collapse.chapters()
.
Is there any way to ensure that the functions are not created as S3 methods?
A very similar question was asked before, but the answer was not entirely clear and my results are slightly different. From those answers, my guess is that R is interpreting the period in SOME of the functions as an indication of a property of an object. The complete list of S3 methods created is
S3method(collapse,chapters)
S3method(collapse,content)
S3method(collapse,definition)
S3method(collapse,html)
S3method(collapse,methods)
S3method(collapse,multicontent)
S3method(collapse,page)
S3method(collapse,section)
S3method(collapse,summary)
S3method(collapse,tags)
S3method(collapse,term)
S3method(collapse,terms)
S3method(update,files)
S3method(update,index)
S3method(start,notation)