sweave

Associate .Rnw with vim latex suite

送分小仙女□ 提交于 2019-12-07 10:56:02
问题 This I am sure is really basic stuff. I am just beginning using gvim and latex-suite. However I would like latex-suite to load when I edit a sweavefile with.Rnw extension. my .vimrc looks like this " These settings are needed for latex-suite filetype indent on filetype plugin on filetype on let g:tex_flavor='latex' set grepprg=grep\ -nH\ $* "let g:Tex_Folding=0 "I don't like folding. set iskeyword+=: and I guess there is some option I can set here that makes vim treat Rnw as .tex? 回答1: Put a

Add TeX path to R Studio - Ubuntu

不想你离开。 提交于 2019-12-07 09:48:46
问题 I'm having the same issue as this question: When I open any .Rnw file, R Studio says that I have no TeX Distribution installed: I'm using Ubuntu 14.04 w/ Gnome and TeXLive 2014. I include the line PATH=/usr/local/texlive/2014/bin:${PATH} in the Renviron.site file, which now looks like: ## Emacs please make this -*- R -*- ## empty Renviron.site for R on Debian ## ## Copyright (C) 2008 Dirk Eddelbuettel and GPL'ed ## ## see help(Startup) for documentation on ~/.Renviron and Renviron.site # ##

If-Else Statement in knitr/Sweave using R variable as conditional (Part 2)

∥☆過路亽.° 提交于 2019-12-07 09:39:34
问题 I am extending a question I posted here: If-Else Statement in knitr/Sweave using R variable as conditional I would like to use an if-else syntax in LaTeX so that, depending on the value of an R variable (say x), one of two LaTeX text paragraphs are output. If x>0, then the LaTeX paragraph has a figure and a table. However, if x<0, then the LaTeX paragraph has just a figure (and no table). I have a MWE that works and is based on the checked answer at the previous post: \documentclass[12pt

Creating R tables with embedded graphics

别等时光非礼了梦想. 提交于 2019-12-06 11:05:50
问题 I'd like to be able to create a table with one of the columns being graphical, others text. Ideally, I'd create an excel spreadsheet, but I'm pretty sure that none of the R to Excel packages can write PDFs into cells. I think I can hack something together using Knittr or Sweave, though I don't know how, exactly. Any advice? 回答1: I've tried to reproduce your example : So I've looked into the R dataset, and used a baseball dataset, though I have the nagging doubt that for baseball players, the

knitr: child document in different directory

旧城冷巷雨未停 提交于 2019-12-06 10:06:26
问题 I can use the following code for child document if it is in the same directory. <<child-demo, child=knitr-input-child.Rnw, eval=TRUE>>= @ I wonder how to use child document if it is not in the same directory of master document. Thanks in advance for your help and time. 回答1: This can be considered as a bug. Now I have fixed it on GitHub. Note, however, you need to setwd() to the directory of your master document before using knit() , otherwise knit() may not be able to find a child inputdir

Rreport/LaTeX quality output package

岁酱吖の 提交于 2019-12-06 08:20:09
I'm looking for some LaTeX template for creating quality output. On R-bloggers I've bumped on Frank Harrel's Rreport package. Due to my quite modest LaTeX abilities, only a user-friendly (and noob-friendly) interface should suffice. Here's a link to an official website. I'm following the instructions, but I cannot manage to install an app. I use Ubuntu 9.10, R version is 2.10.1 (updated regularly from UCLA's CRAN server), and of course, cvs is installed on my system. Now, I'd like to know if there is some user-friendly LaTeX template package (Sweave is still to advanced/spartan for me). I'm

Labels in xtable captions for crossreferencing in lyx

风流意气都作罢 提交于 2019-12-06 06:35:06
问题 I am using pgfsweave with Lyx 1.6.8 and xtable. providing table captions by <<result=tex>>= print(xtable(<dataframe>,caption="Here is my caption")) @. How can I insert a label into the table caption that I can crossreference in the text from the lyx>Insert>Cross-reference menu? I have tried to insert>float>table and inserted print(xtable(<dataframe>,floating=FALSE)) and "Here is my caption" in the Table caption inner frame but this results in (literally): [float Table: <...Table ...> [Table 2:

avoid displayed figures during sweave/pgfsweave compilation

大憨熊 提交于 2019-12-06 05:50:23
问题 When compiling with sweave/pgfsweave, every time a figure is created in R it is shown in a graphics windows (during the sweave compilation process). This is helpful in many cases as I can see what the figures look like as the document is being compiled. But when I compile through ssh a large document this can be very slow. Is there a way to tell sweave/pgfsweave to avoid displaying the figure during the compilation (I still want the figure in the final pdf document though). 回答1: For

header on each page of big table of xtable?

女生的网名这么多〃 提交于 2019-12-06 05:03:59
问题 How do you put on a big table of xtable the table header on each page?, So that is easier to read the table the table between pages. I use the following in Sweave: test.big<- xtable(test,label="table",caption='test') align(test.big) <- "|c|c|c|c|l|c|c|c|" print(test.big,tabular.environment='longtable',include.colnames = TRUE,floating=FALSE) Thanks for your answers 回答1: The longtable (LaTeX) package specification can be found at that URL. The section of code in the examples whose output

How do I print superscripts in a table using xtable and sweave?

為{幸葍}努か 提交于 2019-12-06 04:15:58
问题 So my problem statement is as follows : I have defined a data frame in my Sweave document (.Rnw extension) using the following code: <<label=table2_1,echo=FALSE>>= table2_1_rows <- c('Students with compulsory Evaluations', 'Teachers with compulsory evaluations1', 'Teachers without Evaluation2', 'Students without compulsory evaluations3' ) table2_1_data <- c(1,2,3,4) table2_1final <- data.frame(table2_1_rows,table2_1_data) @ <<label=tab1,echo=FALSE,results=tex>>= print(xtable(table2_1final