Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem using openxlsx2::wb_workbook with roxygen2 #1510

Closed
sbgraves237 opened this issue Aug 23, 2023 · 4 comments
Closed

Problem using openxlsx2::wb_workbook with roxygen2 #1510

sbgraves237 opened this issue Aug 23, 2023 · 4 comments

Comments

@sbgraves237
Copy link

How can I use the R6 coding in package openxlsx2 with roxygen2?
Function

print.FCCquery in GitHub package sbgraves237/broadcastPower

includes

require(openxlsx2)

with

wbO2 <- wb_workbook(title=xNm) wbO2$add_worksheet(sheet='data.frame')

This works when I source and test it locally, but GitHub Action complains:

'library' or 'require' call not declared from: ‘openxlsx2’ ... Please use :: or requireNamespace() instead.

The NAMESPACE file begins, "# Generated by roxygen2: do not edit by hand
". I don't know how to fix this.

When I tried,

wbO2$openxlsx2::add_worksheet(sheet='data.frame')

document()

gave

Error in load_all() ... unexpected '::'
66: class(xdf) <- 'data.frame'
67: wbO2$openxlsx2::

What do you suggest? Thanks, Spencer Graves

@gaborcsardi
Copy link
Member

I don't think that this is not a roxygen2 issue. Instead of library() calls, import the needed objects in the NAMESPACE file.

@sbgraves237
Copy link
Author

sbgraves237 commented Aug 23, 2023 via email

@gaborcsardi
Copy link
Member

See the docs about importing objects here: https://roxygen2.r-lib.org/articles/namespace.html#imports

I.e.

#' @importFrom pkg fun

@sbgraves237
Copy link
Author

sbgraves237 commented Aug 23, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants