R - Roxygen2 does not see updated package definition when rebuilding and rebooting

For example, as a minimal working example, let's say I built the following package Test:

# In R\Test.R :
#' @import methods 
#' @exportClass C
C <- setClass("C")

and now I change setClassto setRefClass:

C <- setRefClass("C")

when executing 'Build and Reload' (in RStudio) I get an error

==> roxygenize('.', roclets=c('rd', 'collate', 'namespace'))

* checking for changes ... ERROR

Error in getRefClass(class) : 
  class  C  is defined but is not a reference class

Well, of course, this is not a reference class yet, but in my updated package it will be! Checking the old class definition also triggers strange warnings:

> getClass("C")
Virtual Class "C" [package "Test"]

No Slots, prototype of class "NULL"
Warning message:
In .recacheSubclasses(def@className, def, doSubclasses, env) :
  undefined subclass "C" of class "refObject"; definition not updated

Roxygen seems to be ignoring my new definition C, and the old class definition is still standing. How can I get Roxygen to focus on my new definition and for my recovery to succeed?

( , setClass - .)

:

Roxygen RStudio , , NAMESPACE , @export.

  • Roxygen2 3.0.0
    • roxygen ( RStudio):
      • Rd
      • NAMESPACE
    • ( RStudio):
      • R CMD
  • R: 3.0.2 (Frisbee Sailing)
  • IDE: RStudio 0.98.490
  • : Windows 8.1
+4

Source: https://habr.com/ru/post/1525018/


All Articles