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

Wrap \usage string and alias for S4 classes and methods #26

Closed
wants to merge 2 commits into from
Closed

Wrap \usage string and alias for S4 classes and methods #26

wants to merge 2 commits into from

Conversation

eusebe
Copy link

@eusebe eusebe commented Jul 31, 2011

Please consider this patch which should fix #21
and fix alias for S4 classes and methods (http://cran.r-project.org/doc/manuals/R-exts.html#Documenting-S4-classes-and-methods)

David

@eusebe
Copy link
Author

eusebe commented Aug 2, 2011

I've just seen that there is a little bug with the first commit. For S3 method, the Rd file looks like:

\usage{
  \method{print}{foo}
(x, a = "sdmldsflkjmsqdlkfjk", b = "fmqlk", c = "\n\np. \n\n", ...)
}

There is a newline after \method, producing a warning with R CMD check. I've been looking and looking, but I can't see where this newline comes from...

@eusebe
Copy link
Author

eusebe commented Sep 20, 2011

With the development version of roxygen, it seems that S4 classes and methods are not documented correctly. \alias{} should be of the form:
theclass-class
generic,signature_list-method

Consequently, my classes and methods appear not documented with R CMD check:

* checking for missing documentation entries ... WARNING
Undocumented S4 methods:
  generic 'print' and siglist 'Report'
  generic 'print' and siglist 'asciiCbind'
...

I tried to make a (possibly not very elegant) patch for this, is there a chance that it is considered for inclusion?

format.usage_tag <- format_collapse
format.usage_tag <- function(x, ...) {
values <- str_c(x$values, collapse = "\n\n ")
rd_tag(x$tag, paste(" ", values, sep = ""), space = TRUE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please use str_c here?

@hadley
Copy link
Member

hadley commented Oct 25, 2011

Would you mind also including a few test cases?

@hadley
Copy link
Member

hadley commented Jan 21, 2012

Closing because I think the usage issue has been dealt with, and S4 needs deeper changes.

@hadley hadley closed this Jan 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad wrapping of long character arguments
2 participants