-
-
Notifications
You must be signed in to change notification settings - Fork 878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sexpr values from external chunk not found #229
Comments
so you have a line like |
I do not use I do indeed have knitr markup in my code. For example:
etc. Here is my
|
Try
I tried on a simple example, and removing the quotation marks worked |
This did not do the trick, unfortunately. Is there a problem with referencing variables from a previous chunk? For example, I have:
where the object
|
Hmmmm. Are d2 etc in the global environment when you finish knitting the document? If you have cache=T then have you deleted the cache files to force everything to be reevaluated. |
They are not when I finish knitting the document, but they are if I just run the R script on its own. I am not cacheing anything, so that should not be the issue. |
Can you remove Although I do not think the version matters for this problem, the current knitr version on CRAN is 0.5 now, so you may update it before moving on. |
I think I discovered the problem: |
You are welcome. Glad you sorted it out finally! |
…can realize the problem when the chunk is not supposed to be empty; for #229
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
I have a large external R script, which I am trying to incorporate via knitr's
read_chunk
function. However, for some reason none of the variables referred to in the surrounding text are able to be found. I have confirmed that the R script runs cleanly on its own, so it is not a case of the script failing before variables are defined. I had a look to see if others have had similar problems, but could not find anything, so I assume I am doing something wrong.I am reading in the file using
read_chunk
in a setup section:And below that, I use pieces of the script that I have annotated as follows:
So, to give one example, there is an object
d2
that is defined in the script within thekm
section, and in the text below, I refer to it as follows:However, I end up with errors as follows:
In fact, there is not a single instance of a Sexpr statement being properly processed. Any idea what I am doing wrong?
The text was updated successfully, but these errors were encountered: