1

When I try to knit the default Rmarkdown sample in RStudio i cannot convert it to either PDF or HTML.

This appears:

Error in xfun::normalize_path(path, ..., must_work = must_work, resolve_symlink = FALSE) : 
  unused argument (resolve_symlink = FALSE)
Calls: <Anonymous> -> normalize_path
Además: Warning message:
Can't find generic `sew` in package knitr to register S3 method.
i This message is only shown to developers using devtools.
i Do you need to update knitr to the latest version? 
Ejecución interrumpida

I already tried to remove xfun and reinstall it but it is not working.

5
  • 1
    "Do you need to update knitr to the latest version?" <- well, do you? What version are you running?
    – Mark
    Commented Nov 15, 2023 at 1:56
  • Yes, you do (at least update knitr and xfun).
    – Yihui Xie
    Commented Nov 15, 2023 at 5:30
  • I do have updated both packages and still get the same error. I attach the versions > packageVersion('knitr') [1] ‘1.30’ > packageVersion('xfun') [1] ‘0.30’
    – DanMar
    Commented Nov 15, 2023 at 10:34
  • knitr 1.30 was released more than 3 years ago, and xfun 0.30 was 20 months ago, so they are definitely outdated (see cran.rstudio.com/package=knitr and cran.rstudio.com/package=xfun for latest version numbers). If you have tried to update packages and still don't get latest versions, your R version is probably too old and you should upgrade R first (I have mentioned this in the post linked in my previous comment). It will be clearer if you could provide sessionInfo() or xfun::session_info('rmarkdown') in your post.
    – Yihui Xie
    Commented Nov 15, 2023 at 15:24
  • 1
    Once I did session Info as you asked, I acknowledged that RStudio was using an outdated version of R in my computer. I eliminated it so as to only select the updated one and now is working fine. Thank you so much, I appreciate it a lot. Best of luck.
    – DanMar
    Commented Nov 15, 2023 at 21:02

1 Answer 1

0

You need to update the xfun package, or just update all packages:

update.packages(ask = FALSE, checkBuilt = TRUE)

(Posting an answer here so that we could mark posts like this one as duplicates.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.