Yishin Lin
Yishin Lin

Reputation: 51

Knit does not produce figures

I encounter a problem related to the usage of knit in RStudio. Your suggestion and help are greatly appreciated. Below is the description of the problem.

After I upgraded the RStudio 0.97.168 to 0.97.237 as well as R 2.15.1 to R 2.15.2 in a Ubuntu 11.10 machine to sort out the problem related to the error message

package ‘xxx’ is not available (for R version 2.15.1),

I found out that the knit no long produces figures, even the code instructs to do so. The resultant html file is still produced and can be examined via the firefox browser, but the figure folder and the image file inside do not exist. Because I have not found any posts discussing this problem, I am wondering if I searched the wrong key words or this is a new problem?

I upgraded because changing the repository mirror did not solve the problem of package installation. After upgrading to R 2.15.2, the problem of package installation is sorted indeed.

Thanks again for your time and attention.

Upvotes: 1

Views: 976

Answers (3)

Yihui Xie
Yihui Xie

Reputation: 30194

OK, everybody seems to have realized this problem was just due to the lag of CRAN mirrors; knitr 0.9 depends on evaluate 0.4.3; the latter was uploaded earlier than the former. The problem is solved by waiting for a while for the new versions of both packages to arrive at your CRAN mirror.

Upvotes: 1

Yishin Lin
Yishin Lin

Reputation: 51

Thanks Yihui for the prompt reply and the releasing new version of knitr. I really appreciate the usefulness of knitr package.

After I upgraded the knitr 0.9 you just uploaded. The problem is sorted. I then try to reproduced the error by manually reinstalling the knitr 0.8, and the error happened again. Below are my computer's outputs by executing sessionInfo() when 0.9 and 0.8 at work, respectively.

R version 2.15.2 (2012-10-26)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8       
 [4] LC_COLLATE=en_GB.UTF-8     LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
 [7] LC_PAPER=C                 LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] knitr_0.9

loaded via a namespace (and not attached):
[1] digest_0.6.0   evaluate_0.4.3 formatR_0.7    plyr_1.7.1     stringr_0.6.1  tools_2.15.2 

-------------------------------------------------------------------------------------------

R version 2.15.2 (2012-10-26)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8       
 [4] LC_COLLATE=en_GB.UTF-8     LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
 [7] LC_PAPER=C                 LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] knitr_0.8

loaded via a namespace (and not attached):
[1] digest_0.6.0   evaluate_0.4.3 formatR_0.7    plyr_1.7.1     stringr_0.6.1  tools_2.15.2 

Upvotes: 0

Giuseppe
Giuseppe

Reputation: 816

I had the same problem, just download the knitr_0.9.zip manually and copy the files into your knitr directory from the .libPaths() dirs.

Upvotes: 0

Related Questions