knitr

starting R: Error: '\U' used without hex digits in character string starting “”C:\U"

坚强是说给别人听的谎言 提交于 2020-02-03 08:43:06
问题 I have the following problem when starting RStudio and when I try to compile a PDF from a .rnw format: Error: '\U' used without hex digits in character string starting ""C:\U" When starting RStudio or just R this is what is inside my console: R version 3.4.0 (2017-04-21) -- "You Stupid Darkness" Copyright (C) 2017 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it

starting R: Error: '\U' used without hex digits in character string starting “”C:\U"

非 Y 不嫁゛ 提交于 2020-02-03 08:42:20
问题 I have the following problem when starting RStudio and when I try to compile a PDF from a .rnw format: Error: '\U' used without hex digits in character string starting ""C:\U" When starting RStudio or just R this is what is inside my console: R version 3.4.0 (2017-04-21) -- "You Stupid Darkness" Copyright (C) 2017 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it

How do I insert a line break in an xtable caption?

≯℡__Kan透↙ 提交于 2020-02-02 13:37:00
问题 I'm sure it's a simple solution but Ive been searching all day trying to solve this. All I want to do is split an xtable caption over 2 lines. I've tried \n and caption.width to no avail. \documentclass{article} \usepackage{caption} \begin{document} <<makedata,echo=TRUE,results='asis'>>= df <- matrix(round(rnorm(9, 20, 10)), 3, 3) colnames(df) <- c("Column1","Column2","Column3") require(xtable) print (xtable(df, caption="Title1\nTitle2"),caption.placement="top") @ \end{document} 回答1: I think

Extending Stargazer

爱⌒轻易说出口 提交于 2020-02-01 04:21:06
问题 I've long used apsrtable to quickly create model comparison tables, but I find it somewhat unattractive and clunky, so my dissertation tables were hand-coded tables with \Sexpr expressions. I was excited to find stargazer , but disappointed that some models I use aren't supported. With apsrtable you can fairly easily extend a model by updating the apsrtableSummary and ModelInfo methods (as in this question/answer). I've been looking (but haven't found) for a similar method to extend stargazer

Rstudio will not knit

◇◆丶佛笑我妖孽 提交于 2020-01-30 10:56:17
问题 Rstudio will not knit. I have been using it for a few weeks in a course. When I try to knit it executes until it comes to some code and it stops. The code is ggplot(data = gss, aes(x = year, fill = degree)) + geom_bar() The message is could not find function "ggplot" This happens with other functions as well. With the code commented out is will run and produce an HTML file. I have reinstalled R and Rstudio twice. I have had difficulty with my AV software (Bitdefender) blocking the install of

Rmarkdown output to word creates one table instead of two

我的未来我决定 提交于 2020-01-30 06:19:50
问题 Rmarkdown output to word creates one table instead of two The code below is expected to create two independent tables when I knit a Word document using Rmarkdown in Rstudio, but instead it creates one combined table. Code expected to create a word document with two tables: --- title: "Untitled" output: word_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = FALSE) ``` ## R Markdown ```{r} knitr::kable(head(iris)) ``` ```{r} knitr::kable(head(iris)) ``` But it only creates

Hide comments in R markdown

久未见 提交于 2020-01-29 21:24:06
问题 Is is possible to hide some comments in code when kniting using knitr / R markdown? Example: --- title: "SOSO" author: "SO" date: '2017-06-06' output: pdf_document --- ```{r} # Generate some data rnorm(2) ## But keep this comment ``` When kniting I would like the first comment to disapear, but keep the second one somehow. 回答1: Here is a quick example of modifying the hook to change knitr behavior. --- title: "SOSO" author: "SO" date: 2017-06-06 output: pdf_document --- ```{r setup-hook, echo

Hide comments in R markdown

拈花ヽ惹草 提交于 2020-01-29 21:23:57
问题 Is is possible to hide some comments in code when kniting using knitr / R markdown? Example: --- title: "SOSO" author: "SO" date: '2017-06-06' output: pdf_document --- ```{r} # Generate some data rnorm(2) ## But keep this comment ``` When kniting I would like the first comment to disapear, but keep the second one somehow. 回答1: Here is a quick example of modifying the hook to change knitr behavior. --- title: "SOSO" author: "SO" date: 2017-06-06 output: pdf_document --- ```{r setup-hook, echo

Hide comments in R markdown

余生长醉 提交于 2020-01-29 21:23:03
问题 Is is possible to hide some comments in code when kniting using knitr / R markdown? Example: --- title: "SOSO" author: "SO" date: '2017-06-06' output: pdf_document --- ```{r} # Generate some data rnorm(2) ## But keep this comment ``` When kniting I would like the first comment to disapear, but keep the second one somehow. 回答1: Here is a quick example of modifying the hook to change knitr behavior. --- title: "SOSO" author: "SO" date: 2017-06-06 output: pdf_document --- ```{r setup-hook, echo

Embedding a beamer presentation in a regular document with RMarkdown

孤人 提交于 2020-01-24 21:32:47
问题 My aim is write a document in markdown ( rmarkdown , more specifically), that can be compiled both to a regular PDF (or other) file and a beamer presentation at the same time, from the same source. (Using knitr .) Scenario: the document includes, in addition to the regular text, one sentence summaries for each paragraph and these should go to the presentation as the bullet points. I know that I can compile a document to several different output formats at the same time with knitr , but the