Error when trying to knit r markdown file

I am trying to knit a rmd file but keep getting an error.

The code works fine. Here is the code:
brk_letters <- readtext(files_v, encoding = "UTF-8")

And here is the error:

Any help would be appreciated!

readtext() is from the readtext package. Could it be that you forgot to import it (library(readtext)) at the beginning of the rmd?

1 Like

Hi Almendal99 I fixed that error but now I'm getting a similar error:

The code works fine, if it upload to bookdown it works fine but it won't knit - very frustrating.

It seems that if I reproduce all the code on the page I want to knit, it works fine. But for some reason it isn't "seeing" the output from the other Rmd page.

I think the problem is that I didn't realize that each Rmd page is standalone and I have to reload and run the code on each page. For some reason it doesn't share the global environment.

Are you in a bookdown project ?

If so, by default all your Rmd should be rendered using the same environment as they will be merged together

If you have set new_session = TRUE it will be each Rmd rendered in its own new R process


Can you share more on what you are doing ? That would help me help you.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.