Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
284 views
in Technique[技术] by (71.8m points)

R Package, R Markdown: Function can not be found while knitting (even if in NAMESPACE and works fine while not knitted)

I am building a R package with the help of Hadley Wickham book. However I encounter an issue while knitting a vignette. I get this error (I rewrote the names of the vignette and function):

"Quitting from lines 208-212 (nameofthevignette.Rmd) Error in foo(argument1, argument2, argument3 : "foo" function can not be found Calls: ... handle -> withCallingHandlers -> withVisible -> eval -> eval Execution halted"

It appears that I have a problem with the "foo" function and that it can not be found. However, it is exported and listed in the NAMESPACE file and the "foo" function works if I run it. The problem appears only when knitting entirely the vignette using it. If I run the vignette chunk by chunk it works. In this vignette I also call other functions from my package before calling the "foo" function and there is no problem with them. No error or warning either when I check or build my package (devtools::check(), devtools::build()).

Do you have any idea of what can cause such an issue and how to resolve it?

Thank you for your help!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...