What does "incomplete block on file" mean?

I am using RStudio, and am trying to use packrat with my current project. I click the checkbox "Use packrat with this project" and press OK, where I get the following output from the console: > packrat::init() Initializing packrat project in directory: - "/Users/Ash/Dropbox/Uni/2014/Thesis/Code/R" Adding these packages to packrat: _ packrat 0.4.0.12

“不完整的文件块”是什么意思?

我正在使用RStudio,并试图使用我当前项目的packrat。 我点击复选框“Use this packrat with this project”,然后按OK,我从控制台得到以下输出: > packrat::init() Initializing packrat project in directory: - "/Users/Ash/Dropbox/Uni/2014/Thesis/Code/R" Adding these packages to packrat: _ packrat 0.4.0.12 Fetching sources for packrat (0.4.0.12) ... Error in snapshotSour

Add margins with grid R package

I don't know how to specify margins for PDF printing with grid R package. I create a grid.arrange() object and I put it in a PDF like this : pdf('test.pdf',11.69,8.27) grid.arrange(textGrob('text1', gp=gpar(cex=4)), ncol=1, main=textGrob('title', gp=gpar(cex=1.5)), widths = c(1), heights = c(1)) dev.off() But the title is push at the top edge of the sheet. I wou

添加网格R包的边距

我不知道如何使用grid R包为PDF打印指定页边距。 我创建了一个grid.arrange()对象,并将其放在PDF中,如下所示: pdf('test.pdf',11.69,8.27) grid.arrange(textGrob('text1', gp=gpar(cex=4)), ncol=1, main=textGrob('title', gp=gpar(cex=1.5)), widths = c(1), heights = c(1)) dev.off() 但标题被推到了表格的最上方。 我想补充利润。 如果我添加一个textGrob而不是标题的main=函数,我可

Can't find gfortran 4.8 to build package

I'm trying to install the deldir package in R via install.packages("deldir",type = 'source') but am getting the following error message (this is OSX Mavericks): * installing *source* package ‘deldir’ ... ** package ‘deldir’ successfully unpacked and MD5 sums checked ** libs gfortran-4.8 -fPIC -g -O2 -c acchk.f -o acchk.o make: gfortran-4.8: No such file or directory mak

无法找到gfortran 4.8来构建包

我试图通过install.packages("deldir",type = 'source')在R中安装deldir包,但得到以下错误消息(这是OSX Mavericks): * installing *source* package ‘deldir’ ... ** package ‘deldir’ successfully unpacked and MD5 sums checked ** libs gfortran-4.8 -fPIC -g -O2 -c acchk.f -o acchk.o make: gfortran-4.8: No such file or directory make: *** [acchk.o] Error 1 ERROR: compilation failed f

How to show working directory in R prompt?

This question already has an answer here: Display a time clock in the R command line 5 answers Because prompt option is really just a string, without any special directives evaluated inside (unlike shell prompt), you have to change it if you change working directory to get current working directory inside. The solution you use seems the best to me. A bit hacky, but any solution will be as

如何在R提示符中显示工作目录?

这个问题在这里已经有了答案: 在R命令行中显示一个时钟5个答案 由于prompt选项实际上只是一个字符串,没有任何特殊指令在内部进行评估(与shell提示符不同),如果您更改工作目录以获取当前工作目录,则必须更改它。 您使用的解决方案似乎对我来说是最好的。 有点古怪,但任何解决方案都会像你想要实现一些R本身不支持的非常基础的东西。 而且,你不必担心函数在base::setwd执行base::setwd ,这会让你的提示与实际工

capturing cat output periodically for R shiny output (renderPrint)

Hope someone can help me with this. Let's say there is a function "example" which is something like ##function from a package example<-function(f){ #does something cat("step 1 done....") # etc etc cat("step 2 done....") return(some_data_frame) } ##server ui code example2<-reactive({ if(input$some_action_button==0)

定期为R闪光输出捕获猫的输出(renderPrint)

希望有人能帮助我。 假设有一个类似于“例子”的函数 ##function from a package example<-function(f){ #does something cat("step 1 done....") # etc etc cat("step 2 done....") return(some_data_frame) } ##server ui code example2<-reactive({ if(input$some_action_button==0) return() result<-isolate(example(input$f1))

MS Word track changes and RMarkDown

I try to write all data analysis reports using R Markdown, because I can have a reproducible document that I can share in several output formats (Pdf, html and MS Word). However, most of my colleagues use MS Word and they have no idea about R, Markdown, etc. One advantage of using R Markdown is that I can generate my report in MS Word and directly share it with my colleagues. The disadvanta

MS Word跟踪更改和RMarkDown

我尝试使用R Markdown编写所有数据分析报告,因为我可以拥有可以以多种输出格式(Pdf,html和MS Word)共享的可重现文档。 然而,我的大多数同事使用MS Word,他们不知道R,Markdown等。 使用R Markdown的一个优点是我可以在MS Word中生成报告并直接与同事分享。 缺点是协作对我来说很麻烦,因为我也收到了MS Word的反馈(通常使用跟踪更改),我必须手动将这些更改重新导入到.rmd文件中。 因此,我的问题是:如何简化将

how to comment out R code blocks in R markdown?

I'm editing an R markdown file (.Rmd) that has a lot of R code blocks to move groups of those code blocks into "child" documents to simplify rearranging sections (if nothing else). As I convert sections to child documents, I would like to test the new child document without running the rest of the blocks and other children. However, when I use to comment out those sections, the R

如何评论R markdown中的R代码块?

我正在编辑一个具有大量R代码块的R markdown文件(.Rmd),以将这些代码块的组移动到“子”文档中,以简化重新排列节(如果没有其他内容)。 当我将部分转换为子文档时,我想测试新的子文档而不运行其他的块和其他子项。 但是,当我使用注释掉这些部分时,R块仍然运行(但RStudio使这些部分“看起来”好像被注释掉了一样)。 如果我消除了前面和后面的“``”(即代码块符号),注释工作正常。 然而,正如我所说,我有很多代码块,

How do I comment out text in an RMD file?

In R markdown (.Rmd) file, how do I comment out unused text? I'm not referring to the text in the R code chunk, but the general texts, like % in LaTex for example. I think you should be able to use regular html comments: <!-- regular html comment --> Does this work for you? Extra yaml blocks can be used anywhere inside the document, and commented out with # --- title: "Untitled

如何注释RMD文件中的文本?

在R markdown(.Rmd)文件中,我如何评论未使用的文本? 我不是指R代码块中的文本,而是一般的文本,例如LaTex中的% 。 我认为你应该可以使用常规的html评论: <!-- regular html comment --> 这对你有用吗? 额外的yaml块可以用在文档的任何地方,并且用# --- title: "Untitled" output: html_document --- No comment. --- # here's a comment # ```{r} # x = pi # ``` --- 但请注意,这并不妨碍knitr评估

Use TableTools for DataTables in R Shiny for renderDataTable

For this question, I am using the R Shiny tutorial example found here: http://rstudio.github.io/shiny/tutorial/#datatables Running the code on this tutorial renders the application at the following URL http://glimmer.rstudio.com/yihui/12_datatables/ What I would like to know is, once that data table is rendered, we can search it using the functionality built into the renderDataTable() fun

对于renderDataTable,使用R Shiny中的TableTools for DataTables

对于这个问题,我使用了这里找到的R Shiny教程示例: http://rstudio.github.io/shiny/tutorial/#datatables 运行本教程中的代码将在下面的URL中呈现应用程序 http://glimmer.rstudio.com/yihui/12_datatables/ 我想知道的是,一旦呈现数据表,我们可以使用R Shiny中的renderDataTable()函数内置的功能来搜索它,但是可以使用renderDataTable()将已过滤的数据下载到数据表中。功能? 例如,如果在数据表搜索栏中输

Complete bibliography with markdown for scientific papers

I was wondering whether there is a way for me to completely use Markdown language for writing a scientific paper along with R. I gave up on using Latex with knitr a while ago, since most of the journals need .docx files for submission, and converting from Latex to docx with pandoc is not always easy, especially when you get long scientific papers and you end up wasting hours debugging pandoc for

完整的参考文献与降价科学论文

我想知道是否有一种方法可以让我完全使用Markdown语言与R一起编写科学论文。由于大多数日志需要.docx文件以供提交,因此我放弃了使用Latex和knitr。从Latex到docx与pandoc并不总是那么容易,尤其是当您收到长篇科学论文时,最终会浪费几个小时来调试pandoc,以发现Latex(和pdflatex)可以轻松传递的微小错误。 无论如何,我想用pandoc的灵活性来使用knitr的力量,降价似乎是一个很好的共同点。 唯一的问题似乎是期刊需要的参