Hello I am having an issue that a lot empty sections are created that show up as a note in r cmd check
it is a similar issues as mentioned here but unfortunately no working solution is presented:
i am using rstudio 1.3.959 and using roxyen2 7.1.0 and devtools 2.3.0.
using devtools::document() on the following code:
#' Function to retry failed functions after a time out of 5 seconds. Especially useful for failed api calls.
#'
#' @param max maximum number of retries, default = 2
#' @param init initial state of retries should always be left zero.
#' @param retryfun function to retry
#'
#' @return
#' @export
#'
#' @examples retry(sum(1,"a"), max = 2)
retry <- function(retryfun, max = 2, init = 0){
suppressWarnings( tryCatch({
if (init < max) retryfun
}, error = function(e){message(paste0("api request failed, automatically retrying time ",init + 1)) ;Sys.sleep(time = 5); retry(retryfun, max, init = init + 1)}))
}
leads to and retry.Rd file that looks like this:
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/refinitiv.r
\name{retry}
\alias{retry}
\title{Function to retry failed functions after a time out of 5 seconds. Especially useful for failed api calls.}
\usage{
retry(retryfun, max = 2, init = 0)
}
\arguments{
\item{retryfun}{function to retry.}
\item{max}{maximum number of retries, default = 2}
\item{init}{initial state of retries should always be left zero, default = zero}
}
\value{
}
\description{
Function to retry failed functions after a time out of 5 seconds. Especially useful for failed api calls.
}
\examples{
retry(sum(1,"a"), max = 2)
}
and when using devtools::check(document = FALSE) this leads to the following note:
> checking Rd files ... NOTE
prepare_Rd: retry.Rd:16-18: Dropping empty section \value
Can someone please tell me what I am doing wrong here please.