Skip to content

"Unused argument" warning for S3 method's argument

checkUsage(\(x) round(x, units = "days"))
<anonymous>: possible error in round(x, units = "days"): unused argument (units = "days")

Of course, that's simply an argument in the S3 method, not the generic:

"units" %in% names(formals(round.POSIXt))

A silly workaround in this particular case is to call round.POSIXt() directly, but that's not a good solution in general.