Citing a function from someone else's Package

In a new package I am developing, I need to use an unexported function(survmean) from Survival package.
#' @importFrom does not work and other alternative are not the best practices for putting the package in CRAN: borrowedfun <- pkg:::fun()
fun <- utils::getFromNamespace("fun", "pkg")

I am thinking of copying the source of the package and citing the original package. I can't find a documentation of citing/referencing the other package. How do I properly cite when I borrow the source of an internal function of someone else's package.

The survival package is licensed using GPL:

License: LGPL-2 LGPL-2.1 LGPL-3 [expanded from: LGPL (≥ 2)]

This means you have to comply with the GPL when you re-use code, and this generally means:

  • You must list the author of survival as a co-author of your package
  • You have to clearly indicate that this code originates from survival, AND
  • You must licence your package using a license that's compatible with the GPL. Usually this means your own package should be GPL as well, compatible with the survival license.

@andrie I will be mentioning the author of survival package and citing the code origin. I am looking for reference/examples of instances where similar citation was done. Am I supposed to use BibTeX references?