How to document a defunct function properly?
Asked Answered
rrd
W

0

6

What I have read

I have read this SO question and related answers but I am still a bit at loss of how to document a defunct function properly in my package.

What I have tried

  • I replaced the code of my defunctfucntion by a call of .Defunct("<pointer to a function to be used instead>", "<my package name>")
  • I deleted the .Rd file containing the old documentation of my function
  • I created a mypackage-defunct.Rd file with an alias pointing to my now defunct function name
  • In mypackage-defunct.Rd I created an \usage entry for my old function and replaced the function arguments by \dots (as I do not see the need to keep track about the old arguments. I followed a bit what is done in base-defunct)

What I have got

When running RCMD CHECK I get the following WARNING:

checking Rd \usage sections ... WARNING Undocumented arguments in documentation object 'mypackage-defunct' '...'

Functions with \usage entries need to have the appropriate \alias entries, and all their arguments documented. The \usage entries must correspond to syntactically valid R code. See chapter 'Writing R documentation files' in the 'Writing R Extensions' manual.

What I would like to have

How do i get rid of the warning? Do I need to document arguments from defunct functions? Bonus question: What is the recommended way for a defunct function. Should I remove all arguments and replace them by ...? Looking at base-defunct, I see a mix of functions with proper argument names, . and ...arguments and empty argument lists. What is the "correct" way?

Workbook answered 6/11, 2017 at 8:27 Comment(3)
I'm also wondering the same thing. Coincidentally it's only 5 days after your question. Let's see if I get responses on twitter twitter.com/daattali/status/929561336337403904Padua
How did you finally handle it?Bassorilievo
It's been a while now, but IIRC, I replaced the arguments in the defunct by ...Workbook

© 2022 - 2024 — McMap. All rights reserved.