Closed ilyaZar closed 2 years ago
What is exported and what is not exported does not have much to do with R6. The NAMESPACE
file configures the exported objects of a package.
You probably need to remove the classes you don't want to export from NAMESPACE
. Or, if you use roxygen2 to generate NAMESPACE
, then you need to remove @export
tags and re-generate the NAMESPACE
file.
Thanks, there was an @export
tag hidden in the problematic subclass!
Setup with R package using
R6
:I have a
class A
with private fields which are themselves classes e.g.classB1
,classB2
etc. All classes are documented, but onlyclass A
has an@export
tag (because it's meant for the end-user).Also, public members from
class A
(which are meant to be the end-user interface i.e. getters/setters) provide access, via above private fields to public member functions ofclassB1
,classB2
.Aim: I want to document all classes A,B1,B2,... but explicitly do not want to export
classB1
,classB2
. Still I want to have the documentation ofclassB1
,classB2
for internal development to be accessible via?pkgName::classB2
.Currently, I have access to
pkgName::classB1
, though it should be only accessible viapkgName:::classB1
, or am I missing something obvious here?Is that intended or a bug? If intended, is it possible to suppress exporting explicitly (i.e. only allow
pkgName:::classB1
but notpkgName::classB1
)?