Error with R function using Knitr in Lyx

I get an error when using the summary () function using Nitron in Lyx. Functions preceding it work.

<<>>=
library(faraway)
head(teengamb)
mdl <- lm(gamble ~ sex + status, data=teengamb) 
summary(mdl)
@

I entered this code through Insert Tex Code in Lyx. I just checked, I can run a resume (teengamb), but not a resume (mdl). Both codes work in RStudio.

Error: Undefined Control Sequence "with description" \ end {verbatim} ... "

+5
source share
1 answer

This problem was resolved in knitrafter version 1.1. You do not need to change anything in LyX or R. At the moment, you can install the development version:

install.packages('knitr', repos = 'http://www.rforge.net/')

Please ignore both answers below:


( , - ). , upquote , โ€‹โ€‹ T1 ,

\documentclass{article}
\usepackage{upquote}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\begin{document}
\begin{verbatim}
'
\end{verbatim}
\end{document}

upquote fontenc, :

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{upquote}
\begin{document}
\begin{verbatim}
'
\end{verbatim}
\end{document}

T1 - :

, Ubuntu , , upquote.sty R texmf , TeXLive, R upquote.

- R texmf MikTeX Windows.

, :


options(show.signif.stars = FALSE) , , . show.signif.stars = FALSE ( summary(mdl)):

Call:
lm(formula = gamble ~ sex + status, data = teengamb)

Residuals:
    Min      1Q  Median      3Q     Max 
-35.873 -15.755  -3.007  10.924 111.586 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  60.2233    15.1347   3.979 0.000255 ***
sex         -35.7094     9.4899  -3.763 0.000493 ***
status       -0.5855     0.2727  -2.147 0.037321 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 

Residual standard error: 27.99 on 44 degrees of freedom
Multiple R-squared: 0.2454, Adjusted R-squared: 0.2111 
F-statistic: 7.154 on 2 and 44 DF,  p-value: 0.002042 

Signif. codes, , LaTeX: ASCII verbatim.

, @mrdwab, . , OP LaTeX - .

+6

All Articles