knitr

Iteratively producing latex tables in knitr

我的未来我决定 提交于 2019-12-13 06:38:38
问题 I'm working on iteratively producing LaTeX tables using knitr. All is well except I'm left with extra markup before each table. Here's a simple example, though this would ideally work as a template for more complex problems, ie different-size tables, varying data sets etc. What can I do to get rid of the extra text before each table? \documentclass{article} \usepackage{setspace, relsize} \usepackage[margin=.5in, landscape]{geometry} \usepackage{pdfpages} \begin{document} <<setup, include

Working directory issues with knitr - parent and child R Markdown documents

十年热恋 提交于 2019-12-13 05:24:59
问题 I'm having working directory issues when using knitr with parent and child R Markdown documents and external chunks from my R code. I've described the situation and provided links to my code here: https://github.com/yihui/knitr/issues/38 (the issue is closed, but relevant, so I decided to leave my comment there). Would appreciate your help on this! (A copy of this has also been posted to knitr Google Groups.) 来源: https://stackoverflow.com/questions/25705821/working-directory-issues-with-knitr

Automated nicely formated book of lyrics from data.frame using markdown, knitr and glue

╄→гoц情女王★ 提交于 2019-12-13 04:28:32
问题 This is the extension of previous question: Automating the generation of preformated text in Rmarkdown using R. Here's the task: You have a collection of song lyrics stored in data.frame , the columns of which are: song lyrics (with many \n at the end of each line), song title, song album, music author, words author, year, etc... Now you want to produce automatically a nicely formatted book of this poetry using markdown (or bookdown ) and glue packages, which should generate an html of this

unable to find an inherited method for function 'rowData' for signature '“logical”'

三世轮回 提交于 2019-12-13 04:06:37
问题 I have an R markdown code chunk that looks like this ( it is a small part of an extremely large code). filterLowExpressedGenes <- function(sce, cutoffCell, cutoffTranscript){ apply( counts(sce[ , colData(sce)$use]), 1, function(x) length(x[x > cutoffTranscript]) >= cutoffCell) } ``` ```{r include=T} for (i in seq_along(sce_list)) { print(rowData(sce_list[[i]])$use <- filterLowExpressedGenes(sce_list[[i]], 3, 5)) } ``` {r include=T} for (i in seq_along(sce_list)) { print(table(rowData(sce_list

How to write complex kable and ggplot in sections (row and column alignment) to pdf using R Markdown?

邮差的信 提交于 2019-12-13 03:22:38
问题 I am trying to knit several kable and ggplot in sections in one page, details are in the minimal and reproducible example below. I have tried cat("\\twocolumn") kable_styling(position = "float_right") \usepackage{multicol} (Previous Question) Below is the code --- title: "Untitled" output: pdf_document classoption: landscape --- \newpage ```{r cars, echo=FALSE, results="asis", fig.width=3, fig.height=2, message=FALSE} library(dplyr) library(knitr) suppressWarnings(library(kableExtra)) library

Transitioning research project to knitr-based setup

别等时光非礼了梦想. 提交于 2019-12-13 03:03:17
问题 Finally, I've decided to move my dissertation research closer toward the goal of making it as good reproducible research as it can be, given my circumstances. Since currently I don't use LaTeX for my dissertation report (though I'm considering this option), I believe that knitr is the best way to go. The software project, implementing empirical part of my dissertation research ( data analysis ), is being written in R . The project's contains multiple files within directory structure , which

When using servr::jekyll() on R, where should I save my Rmd files?

孤街浪徒 提交于 2019-12-13 02:12:54
问题 With the Rmd files on root (eg. on my /knitr-jekyll/) they are turning into md files, but not on html files. Thus, they appear as simple markdown text. I tried to put them on /_source and on /_posts but it get's worse, in this case I also don't get the md files. 回答1: I found creating a separate folder all together solves the problem. /kintr-jekyll/_rmd/test.Rmd But do remember that when you knit your Rmd to md that you knit to the _post folder if you using the standard bootstrap template.

knitr, lyx, mac, Korean

感情迁移 提交于 2019-12-13 02:06:58
问题 Dear Friends in the knitr community with lyx and Apple Mac Hello! I am using Apple Mac for Reproducible research of R. Currently, I enjoy knitr in lyx for writing some R scripts. The problem I have is related non-English characters, specially Korean in the knitr chunk. When I type any Korean Character in a Chunk for typing file name or some extra explanations in #, the pdf output of the file does not print Korean properly. No matter of choosing or not choosing the option "eval=FALSE", R in

RStudio will not write a .bbl file when compiling .Rnw file with citations in natbib

风流意气都作罢 提交于 2019-12-13 01:27:02
问题 I have a .Rnw file (Test.Rnw) in RStudio with citations. The .bib file is in the same folder as the .Rnw file, but when I compile the .Rnw file, no .bbl file is written out and I get the error: There were undefined citations And checking the log, I find, as expected: No file Test.bbl This is the code I'm trying to compile: \documentclass[12pt, oneside]{article} \usepackage{amsmath,amsfonts,amssymb} \usepackage{graphicx} \usepackage{float} \usepackage[sort,comma,numbers,super]{natbib}

knitr .Rmd -> Word document: control details of figures

喜夏-厌秋 提交于 2019-12-12 22:24:58
问题 I'm producing a solutions manual for a book, using .Rmd files with the following YAML header: --- title: "DDAR: Solutions and Hints for Exercises" date: "`r Sys.Date()`" output: word_document: reference_docx: solutions-setup.docx --- where I control the general layout of the document with the reference_docx to get an output Word document. There will be many figures, and I'd like to set some global graphics parameters to give relatively tight bounding boxes and reasonable font sizes in the