Replies: 86 comments 113 replies
-
When I use xtable in a chunk, I get a grey shaded empty line. Example: |
Beta Was this translation helpful? Give feedback.
-
Hello Yihui, First, thanks a lot for your work, this package is great! I have a problem adding a figure using the layout() function and was wondering if you could help me. An exemple code: <<virees, results="hide" ,echo="F,fig=T,dev="png",dpi=150,fig.height=6,fig.width=10,fig.keep="high"," fig.align="center" ,fig.height="6,fig.width=10">>= If I use that, my figures include only the left plot in the layout. Any idea why? I actually want to print in a report with multiple figures (~250) where each one is the result of a special layout format. Thanks a lot Bastien |
Beta Was this translation helpful? Give feedback.
-
Hi Yihui, congratulations for your work with knitr. I am using it a lot, but I am having problems when I try to supress some lines in the output. It's fine when I use i.e. "echo=2", but I am not able to get "echo= 1:3" . Try this example please: |
Beta Was this translation helpful? Give feedback.
-
Hi Yihui,forget my previous post. I forgot the quotation marks in results= "asis" . Thanks for your fine work |
Beta Was this translation helpful? Give feedback.
-
What is the best practice for chunks where you only want the figures? I can turn off all of the output, but that still leaves a colored, framed box around all the chunks, even if it's just an includegraphics. I also end up with lots of stuff added to the main document header that's never used. Is there any way you could just put that stuff in a latex package and include it like framed is? I can turn off the highlighting, but I still get the framed colorbox. |
Beta Was this translation helpful? Give feedback.
-
Does anyone have nice example of using chunk options in markdown with knitr? I'm lost. |
Beta Was this translation helpful? Give feedback.
-
hi yihui! |
Beta Was this translation helpful? Give feedback.
-
Hi Yihui, I am running Lyx 2.0.3 on Windows XP with loaded module Knitr and have following error popping up while trying to convert R code to TeX: "An error occurred while running> "Do you have a clue what it might be?My document have an empty preamble. I only use the following options in the beginning of the document" In R i have loaded both knitr and tikzDevice packages. I wrote "at" instead of a symbol only here due to mail autocompletion... Best regards, |
Beta Was this translation helpful? Give feedback.
-
Hi Yihui, |
Beta Was this translation helpful? Give feedback.
-
Hi, Yihui, I got a problem using kintr and markdown on ubuntu. x64 here is my markdown code. this code generates animation buttons but it doesn't play on web browser.
Any idea? |
Beta Was this translation helpful? Give feedback.
-
animation option. Currently, support animation.fun ="hook_ffmpeg_html". Is it possible to use animated gif as output? instead of mp4? It will be very nice to make animated PDF from markdown so that we can space in our report!! My motivation behind this is that Thank for your help |
Beta Was this translation helpful? Give feedback.
-
senic ¡- read.table(”pdata.txt”, header = FALSE) colnames(senic) ¡- c(”y”, ”x1”, ”x2”, ”x3”, ”x4”, I used this code for the above result My output does not execute line by line I use Rstudio for my reports |
Beta Was this translation helpful? Give feedback.
-
testfun.Rmd:
I'm not sure if this is a bug (and it doesn't cause knitting a document to stop), but this causes and error:
processing file: testdash.Rmd |
Beta Was this translation helpful? Give feedback.
-
Good work bro. That's indeed a significant step forward in R history. |
Beta Was this translation helpful? Give feedback.
-
At http://jacobwegelin.net/tmp/XieYihui/, in the The pertinent documentation (from http://yihui.name/knitr/options) is: echo: (TRUE; logical or numeric) whether to include R source code in the output file In the same place a 2nd html file can be found which contains the lines from the prevous html that are necessary to display the table, without the preamble that starts the first html file. What is the function of those pound signs? |
Beta Was this translation helpful? Give feedback.
-
Yihui - hello - I am new to knitr and am trying to create a PDF document for an assignment, I am getting the following error: |............ | 18% |.................. | 27% |........................ | 36% Quitting from lines 25-32 (Cars.Rmd) Lines 25 -32 are:
I am assuming it has something to do with the chunk options? |
Beta Was this translation helpful? Give feedback.
-
Yihui, great work - I love to use knit, actually with .Rnw to write a textbook. One question: Is there a way to remove the empty line between the function call and the respective output of the function? Thanks a lot for your support! |
Beta Was this translation helpful? Give feedback.
-
Whenever i print a large vector or a frame, i always get part of my R output out of the margins... ¿Is it possible to adjust the output margins? |
Beta Was this translation helpful? Give feedback.
-
I use beamer slides extensively, as created by Rmarkdown, and always have problems with R output being too wide.
|
Beta Was this translation helpful? Give feedback.
-
Hello Smart People! Here with a question about cross-referencing. I am successfully using @ref(tab:my-table) and @ref(fig:my-figure) to cross reference tables and figures that I created inside R chunks. Yay for me. Then I started writing numbered linguistics examples with code like this:
When I was trying to cross reference my example I was stuck. I trying adding a name to the chunk and captioning the chunk, but no avail. Then by chance I wrote this ref{stm-01} and it work like a charm. So my question is, what is the difference between @ref(tab:my-table) and ref{my-label} Much appreciative! |
Beta Was this translation helpful? Give feedback.
-
Why is this happening? I cannot find the proper argument. My Rmd is: title: |
|
Beta Was this translation helpful? Give feedback.
-
Hi Yihui, in R notebook inline display, the real plot size in the chunk display is consistently about 2.5-3 times larger than the specified fig.width and fig.height in the chunk options. Any comments on what might be causing this issue? Plus, the font size in the chunk display is about 50% larger than the specified font size, when compared with ggsave output. I have tried updating my Rstudio, R, didn't change anything. I also tried to use external monitors, same behavior. I use R notebook as a workhorse and having the right size plot in the chunk display is really important to me. Any insight would be appreciated! |
Beta Was this translation helpful? Give feedback.
-
~ code chunks are related to links on a page while r relates to data packages |
Beta Was this translation helpful? Give feedback.
-
I'm using knitr with emacs and ESS. My console output is getting truncated with with the text "[TRUNCATED]". I believe this is the result of knitr. Is there a setting I can change to remove this? |
Beta Was this translation helpful? Give feedback.
-
How can i include LaTeX-package declarations for HTML output? For instance, if i choose PDF as output format, i can write "usepackage{...}" into a separate TEX-file that i reference in RMD-file by "template: ...". However, if i don't use a separate TEX-file and only want HTML-output then the built-in LaTeX-packages work fine and i can use equations using them but if i want to use a non-buil-in-package then what should i do? There are so many examples out there for primitive things but once it gets complicated i seldom find a solution. |
Beta Was this translation helpful? Give feedback.
-
Sorry for the poor formatting. I can't seem to preview, edit, or delete. I'll try once more with escape characters:
I expect the page element to be <div class="figure myClass" ="">; but instead it remains <div class="figure" ="">. I'm rendering the page with bookdown::html_document2. What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
-
FYI: in
The URL link is broken. Perhaps this is temporary(?), in the meantime, here is another page covering the topic: https://latex-tutorial.com/changing-font-size/ |
Beta Was this translation helpful? Give feedback.
-
Hello yihui I am rendering a pdf document from within Shiny app and at one instance I need to include a png plot previously saved. The Rmd file is placed in the root directory of the shiny app along with global.R, server.R and ui.R. Function Inline, but with no caption (caption throws a "float" error in this case): knitr::include_graphics('./src/coverage001.png', dpi = 72, auto_pdf = TRUE) Inside code chunk preferably with caption: ```{r covPlot, fig.align='center', fig.ncol = 1, fig.sep = '\\par', fig.width = 9, fig.show = 'asis', fig.keep = 'all', fig.cap = sprintf('Protein %s: Coverage', names(chain))}
# coverage plot
knitr::include_graphics('./src/coverage001.png', dpi = 72, auto_pdf = TRUE)
``` When I run the chunk in RStudio, the figure appears under the chunk but not so inside the rendered document. No latex error either in the log file. I am using |
Beta Was this translation helpful? Give feedback.
-
@yihui Thank you for the prompt reply! In other words, what should I add to the chunk options to have the figure appear when I use This is what I mean by inline (example 1):
and this is what I mean by code chunk (example 2):
This is part of my document header, including latex packages (the indents are stripped by the browser - they are correct in the Rmd):
Regarding latex packages: where can I find some succinct information on what latex package(s) to call with Thank you! |
Beta Was this translation helpful? Give feedback.
-
I had a render pdf problem when my images had multiple dots in the filename, knitr.include.graphics.ext not run? |
Beta Was this translation helpful? Give feedback.
-
Options: Chunk options and package options
https://yihui.org/knitr/options/
Beta Was this translation helpful? Give feedback.
All reactions