#r #devtools #roxygen2 #r6
Вопрос:
У меня проблемы с NAMESPACE-ами в пакете R. Я использую классы roxygen2 и R6 внутри моего пакета. Вот мой файл ДОКУМЕНТОВ:
Package: finfeatures
Type: Package
Title: Features for investing and finance
Version: 0.1.0
Author: c(
person("Mislav", "Sagovac", email = "mislav.sagovac@contentio.biz", role = c("cre","aut")))
Maintainer: Mislav Sagovac <mislav.sagovac@contentio.biz>
Description: Create and filter features that are helpfull in predictio problems in
finance. Some basic features filtering techniques are also availabe.
License: GPL-3
URL: https://github.com/MislavSag/finfeatures
BugReports: https://github.com/MislavSag/finfeatures/issues
Imports:
R6,
data.table,
checkmate,
TTR,
roll,
QuantTools,
forecast,
doParallel,
runner,
exuber,
zoo,
parallel,
GAS,
ptsuite,
reticulate,
bidask,
parallel,
doParallel,
mlr3misc,
backports,
lgr
Remotes:
github::ottosven/backCUSUM,
github::andrewuhl/RollingWindow,
github::hendersontrent/theft
Suggests:
roxygen2,
devtools
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.2
Вот мой файл zzz.R, который импортирует все пакеты:
#' @import data.table
#' @import checkmate
#' @import TTR
#' @import forecast
#' @import runner
#' @import theft
#' @import zoo
#' @import parallel
#' @import GAS
#' @import ptsuite
#' @import reticulate
#' @import doParallel
#' @import backCUSUM
#' @import RollingWindow
#' @import mlr3misc
#' @importFrom R6 R6Class is.R6
#' @importFrom roll roll_sd roll_lm roll_quantile
#' @importFrom QuantTools roll_percent_rank sma ema rsi
#' @importFrom bidask spread
#' @importFrom parallel makeCluster clusterExport clusterCall stopCluster
#' @importFrom exuber radf psy_minw augment tidy index
#' @importFrom utils data head tail getFromNamespace
#' @importFrom stats predict rnorm runif sd na.omit
#' @importFrom future nbrOfWorkers plan
#' @importFrom stats as.formula
"_PACKAGE"
У меня есть несколько других файлов в пакете.
Когда я выполняю исключение devtools::document()
, я получаю сообщение об ошибке:
i Updating finfeatures documentation
i Loading finfeatures
Registered S3 method overwritten by 'quantmod':
method from
as.zoo.data.frame zoo
Error in R6Class("Ohlcv", public = list(X = NULL, id_col = NULL, date_col = NULL, (from Ohlcv.R#9) :
could not find function "R6Class"
I can’t understand why document()
function doesn’t create NAMESPACE file.
I have tried to delete NAMESPACE file or to create empty NAMESPACE file.
EDIT:
I have just created github package, so you can see the structure in more details.
https://github.com/MislavSag/finfeatures