For CRAN submission, allowed to source a function from markdown instead of script?

I'm preparing to submit a package to CRAN. Each function is contained in a separate file inside the R/ folder. One of these functions contains a three-part sequential data science workflow and it would help for cleanliness and readability if I could explain this in a .Rmd instead of comment lines. Thus, I would like to include this function in the package as .Rmd instead of .R. Is this possible, and allowed by CRAN?

Would this then require knittr as a dependency for running the package?

You can't write package functions in Rmd files. I'd recommend writing the functions in R files in the R/ subdirectory, and then writing a Rmd file in the vignettes/ subdirectory to explain the details of the workflow to the end user.

1 Like