-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
[R] improve more docstrings #9919
Conversation
The latter seems to fit markdown better? |
That's a point. "ggplot" e.g. doesn't use any highlighting:
Similarly, {lubridate}:
{dplyr} seems to avoid using class names, but here is an example that also uses no highlighting:
But there are also snippets in the Tidyverse docu that use backticks. Hmm 😀. It is not super important, I just wanted to note it somewhere. |
I hope the GitHub user param is okay with the ping. ;-) I don't have a strong preference. For my personal choice, I would simply follow the tidyverse's convention. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the nice work on the document! I don't have a strong preference regarding the style of reference and quote, but would be great if we could pick one and use it consistently. I left some questions in the comments for various uses.
#' @param plot (base R barplot) whether a barplot should be produced. | ||
#' If FALSE, only a data.table is returned. | ||
#' @param n_clusters (ggplot only) a \code{numeric} vector containing the min and the max range | ||
#' @param importance_matrix A `data.table` as returned by [xgb.importance()]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to find the pattern of reference, what's the square bracket? I see that you are using single quote, plain text, square bracket in a mix for various internal references.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is like \link{\code{xgb.importance}}, https://roxygen2.r-lib.org/articles/markdown.html (middle section).
#' @param plot_height the height of the diagram in pixels. | ||
#' @param render a logical flag for whether the graph should be rendered (see Value). | ||
#' @param feature_names Character vector used to overwrite the feature names | ||
#' of the model. The default (`NULL`) uses the original feature names. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is NULL
or (NULL
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No preference.
Let's merge it to unblock the progress. ;-) Again, thank you for the nice work on the documents.
For future references, let's stick to backticks. |
Thanks! Backticks are fine 😀 |
This PR updates the docstrings of these (plotting) functions:
As such, it is the next step towards #9875.
Like in #9906, the changes include:
There are no changes in the code itself.
Note there is one inconsistency that I have not fixed because I don't know what is better: An object of class "xgb.Booster" or an object of class
xgb.Booster
. I.e., how to highlight classes.