MatthieuStigler / matPkg

Other
2 stars 0 forks source link

S3 method `as.data.frame.proc_time` needs @export or @exportS3method tag. #68

Closed MatthieuStigler closed 2 months ago

MatthieuStigler commented 4 months ago

From document(), get:

99_run_check.R:254: S3 method as.data.frame.proc_time needs @export or @exportS3method tag.

But I am not sure I want to export it!?

Discussion:

salim-b commented 2 months ago

Terminology is a pain here.

@exporting a method like as.data.frame.proc_time does not actually export but only register it as an S3 method, i.e. add a line S3method(as.data.frame,proc_time) to the pkg NAMESPACE.

To actually export as.data.frame.proc_time (i.e. add a line export(as.data.frame.proc_time) to NAMESPACE), you'd need to add a separate #' @export as.data.frame.proc_time statement. Cf. this comment by Gábor Csárdi.

tl;dr: Blindy trusting roxygen2's advice tends to be the right thing to do. 🤡

MatthieuStigler commented 2 months ago

hoi @salim-b

thanks a lot for the explanations!