Cloud Stack Ninja

How can we see all available parameters (or view documentation more generally) for a class method?

For example, if we look at arguments for print()


an object used to select a method.

further arguments passed to or from other methods.

logical, indicating whether or not strings should be printed with surrounding quotes.

-- leaving others out for brevity --
logical indicating if internally stored source should be used for printing when present, e.g., if options(keep.source = TRUE) has been in use.

Note that we do not see any documentation for the parameter max_n.

Now suppose we call print() on something of class xml_nodes, e.g:


# Generate an object of class xml_nodes
a <- rep("<p></p>", 30) %>% 
  paste0(collapse="") %>% 
  read_html %>% 

# [1] "xml_nodeset"

a is of class xml_nodeset, and if we call print(a), it prints only 20 results, and that's because (I think) the xml_nodeset class is configured such that when print is called on it, it will only return 20 results. (the '20' number can be changed via the max_n parameter).

How do we find the specific documentation for how print will behave when called on the object of class xml_nodeset? (preferably via RStudio/manuals)

Note that the example above is just a random example, I would like to find a general way of finding documentation for all class methods

Read more here:

Content Attribution

This content was originally published by stevec at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: