-
-
Notifications
You must be signed in to change notification settings - Fork 874
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
knitr and car::recode #413
Comments
I see the line number is 1431, so it must be a very long document. I cannot reproduce the error with the following minimal document: \documentclass{article}
\begin{document}
<<getHowell>>=
add <- read.table('http://www.uvm.edu/~dhowell/methods7/DataFiles/Add.dat', header = TRUE)
add$CaseNum <- factor(add$CaseNum)
library(car)
add$Gender <- Recode(add$Gender, " 1 = 'Male'; else = 'Female' ", as.factor.result = TRUE)
add$Repeat <- Recode(add$Repeat, " 1 = 'RepeatedGrade'; else = 'DidNotRepeatGrade' ", as.factor.result = TRUE)
add$EngL <- Recode(add$EngL, " 1 = 'CollegePrep'; 2 = 'General'; else = 'Remedial' ", as.factor.result = TRUE)
add$EngG <- Recode(add$EngG, " 4 = 'A'; 3 = 'B'; 2 = 'C'; 1 = 'D'; else = 'F' ", as.factor.result = TRUE)
add$SocProb <- Recode(add$SocProb, " 0 = 'No'; else = 'Yes' ", as.factor.result = TRUE)
add$Dropout.f <- Recode(add$Dropout, " 1 = 'Dropped'; else = 'DidNotDrop' ", as.factor.result = TRUE)
@
\end{document} Perhaps that is a LaTeX problem from elsewhere... |
It is indeed a huge document, but the reason I thought I had found the culprit is that the problem goes away when I comment out this block of knitr-generated LaTeX. On Oct 29, 2012, at 3:54 PM, Yihui Xie notifications@github.com wrote:
|
The conflict is with \usepackage{lmodern} The following fails: \documentclass{article} A request: knitr() add a lot of LaTeX code in the preamble. How about writing a file with a different suffix that is included at the beginning of the .tex file. |
Thanks for digging out the culprit and the suggestions. You can probably try For the second question, I think you can use the |
|
Strange. I keep my LaTeX updated weekly (OS X 10.8.2). MK On Oct 29, 2012, at 9:51 PM, Yihui Xie notifications@github.com wrote:
|
I have another question. Can I put some of the knitr code into a boxedminipage (e.g., for exercises). The LaTeX compilation fails: \documentclass{article} On Oct 29, 2012, at 9:51 PM, Yihui Xie notifications@github.com wrote:
|
I guess it is a bad idea in general to put complicated content in \begin{boxedminipage}{\linewidth}
<<>>=
# code here
@
\end{boxedminipage} |
Do you have further questions on this issue? If not, I'll close it. Thanks! |
Please close. MK On Nov 13, 2012, at 1:02 AM, Yihui Xie notifications@github.com wrote:
|
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. |
The following code:
produces:
with throws the followeing error in the console:
! Undefined control sequence. <argument> ' Male' l.1431 ...g{'Male'}; else = \hlstring{'Female'} "} , as.factor.result = TRUE)
The text was updated successfully, but these errors were encountered: