Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

knitr installation in Lyx

Tags:

r

knitr

lyx

I was trying to install Knitr package in Lyx but I encountered the following error.

"The module knitr requires a package that is not available in your Latex installation or a converter that you have not installed. Latex output may not be possible. Package missing Knitr>latex."

I would greatly appreciate if you could please help me to fix this problem. I checked the Lyx module but couldn't figure out exactly what to do. I am a new user to Lyx and Knitr.

Thank you in advance

like image 900
Metrics Avatar asked Sep 16 '12 23:09

Metrics


People also ask

How do you use the Knitr in R studio?

If you are using RStudio, then the “Knit” button (Ctrl+Shift+K) will render the document and display a preview of it.

What is Knitr used for?

knitr is an engine for dynamic report generation with R. It is a package in the programming language R that enables integration of R code into LaTeX, LyX, HTML, Markdown, AsciiDoc, and reStructuredText documents. The purpose of knitr is to allow reproducible research in R through the means of literate programming.


2 Answers

I had this same error message on my Windows 10 machine and found that the error was in the path I provided for R. If you don't have the path all the way to the R executable, it will not work. Change the path in Lyx with Tools>Preferences>Paths and edit the PATH prefix content. I had to add

                C:\Program Files\R\R-3.6.0\bin\x64
like image 31
markhogue Avatar answered Sep 21 '22 07:09

markhogue


That is often an indication of the PATH problem; see the first section of the LyX/Sweave/knitr manual (link to PDF is at http://yihui.name/knitr/demo/lyx/)

like image 128
Yihui Xie Avatar answered Sep 19 '22 07:09

Yihui Xie