lyx

Error with R function using Knitr in Lyx

有些话、适合烂在心里 提交于 2019-12-01 05:50:49
I am getting an error when using the summary() function using Knitr in Lyx. The functions preceding it works. <<>>= library(faraway) head(teengamb) mdl <- lm(gamble ~ sex + status, data=teengamb) summary(mdl) @ I am inputing this code through Insert Tex Code in Lyx. I just tested I can run summary(teengamb) but not summary(mdl). Both codes work in RStudio. The error is "Undefined Control Sequence" with description "\end{verbatim} ..." This problem has been solved in knitr after version 1.1. You do not need to change anything in LyX or R. For now, you can install the development version from:

Error with R function using Knitr in Lyx

大憨熊 提交于 2019-12-01 04:02:32
问题 I am getting an error when using the summary() function using Knitr in Lyx. The functions preceding it works. <<>>= library(faraway) head(teengamb) mdl <- lm(gamble ~ sex + status, data=teengamb) summary(mdl) @ I am inputing this code through Insert Tex Code in Lyx. I just tested I can run summary(teengamb) but not summary(mdl). Both codes work in RStudio. The error is "Undefined Control Sequence" with description "\end{verbatim} ..." 回答1: This problem has been solved in knitr after version 1

R loses information when saving plot as encapsulated postscript (.eps)

谁说胖子不能爱 提交于 2019-12-01 03:19:10
问题 Lyx and Latex work splendidly with .eps images. But when I export a scatter plot with a smoothing curve from Rstudio, the points are lost and the plot is delivered with only the curve. The two save methods I have tried are: In Rstudio, choose "Export" from the drop down menu in the image field and save as .eps. Interestingly, the plot appears as it should in the Rstudio preview. Preface the plot code with setEPS() followed by postscript() , with the desired dimensions and so on, followed by

How to draw a graph in LaTeX?

走远了吗. 提交于 2019-11-29 18:45:46
First of all, let me say I'm using LyX, though I have no problem using ERT. Secondly, what is the most simplest way to draw a simple graph like this in Latex? I've seen some documents with graphs and I've seen some examples, but I couldn't figure out how to just draw a simple graph - what packages do I need, etc? TikZ can do this. A quick demo: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} [scale=.8,auto=left,every node/.style={circle,fill=blue!20}] \node (n6) at (1,10) {6}; \node (n4) at (4,8) {4}; \node (n5) at (8,9) {5}; \node (n1) at (11,8) {1}; \node (n2)