I am creating a personal package with some S4 classes. When I run the Build and Reload button in the Rstudio IDE I get the next message.

in method for ‘checkNewItems’ with signature ‘"webSource"’: no definition for class "webSource"

The Class declaration webSource is in a different file where the checkNewItems method is and I am guessing that is the reason why I am getting that message. In the source code that I have makes more sense to have the class declaration in other place rather than next to the methods checkNewItems.

Which is the idiomatic workaround that R programmers use for this?

Also, from the point of view of the Lazyloading that R uses I assumed that this should not happen.

有帮助吗?

解决方案

You should export your class. In your namespace file you add this:

exportClasses(webSource)
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top