-
-
Notifications
You must be signed in to change notification settings - Fork 965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running rmarkdown from the command line without the need for X11 capability #1100
Comments
It might be due to the fact that the HTML output format uses the PNG device by default. I'm not quite sure, but you can change the default graphics device of your output format (usually the |
In most cases the png() device can use the cairo back-end rather than X11.
My guess is that your version of R doesn't have cario support compiled in
-- you can check this with capabilities("cairo")
…On Sat, Jul 15, 2017 at 10:21 PM, Yihui Xie ***@***.***> wrote:
It might be due to the fact that the HTML output format uses the PNG
device by default. I'm not quite sure, but you can change the default
graphics device of your output format (usually the dev argument) to a
device independent of X11, such as svg.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1100 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGXx1y2hrVzHVHS1IujajFTcBI-7yfPks5sOXO_gaJpZM4OY8LN>
.
|
Thanks a lot for the quick responses. I actually did try the Here I'm invoking
Ok, so as far as I understand this means I have Then, trying this example
Calling it from the command line produces the
Am I not setting the device to Thanks a lot |
Just checking in to see if there's any idea as to why I'm getting that |
Although your Typically this can happen if you build R from source, but your R startup message says "Platform: x86_64-pc-linux-gnu (64-bit)", which indicates that you probably installed a prebuilt binary (what exactly is your OS?). There might be something wrong with the binary package. |
You're right. I do get the My OS is Linux |
Yeah I know it is Linux. I mean the specific distribution. I haven't had problems like this with Debian/Ubuntu ( |
Sorry about that, |
I see. Then I cannot offer much help. A blind shot is to upgrade R and see if it makes any difference (the latest version of R is 3.4.1 now). |
I have the same problem. I am trying to run the render function on a cluster without x11 (R -e "rmarkdown::render('test.Rmd')"). Using the opts_chunk$set doesn't do anything. However when I added the following line: My solution works but I am not 100% happy as I would prefer to have all code in the document. Do you have any suggestions? |
@lillamy2012 Are you also using Red Hat? My guess is that it is an issue with base R (I have pointed out the relevant line in R source above). I think you can set |
Hi Yihul! Thank you very much for the reply.
That is, in this test.Rmd I do not even generate a plot. As before, with the options(bitmapType = 'cairo') in a .Rprofile it runs without problem. The output I get is:
So the error occurs in the setup chunk. I will try to talk with the guys handling the cluster here to see how R was installed and if they can help out by e.g reinstalling R. Thanks again! |
@lillamy2012 Excellent. That is super helpful. I know how to fix it now. |
Fix #1100: respect knitr's chunk option 'dev' if it has been set
To add to this discussion, I have a weird X11 issue when I run rmarkdown. The error I get is: I run R on a linux cluster: I connect to the cluster using a Windows machine (in which case I use MobaXterm). I also connect to the cluster from MacOS, in which case I use the default terminal. Following is the weird issue I have: Any idea why this inconsistency based on the mode I use to connect to the Linux cluster? |
@hariiyer16 Is everything up-to-date on the cluster? e.g. Have you tried |
It ended up being a combination of how R is inatslled and having to run it
with: xvfb-run R -e rmarkdown::render
…On Wed, Feb 7, 2018 at 12:29 PM, Yihui Xie ***@***.***> wrote:
@hariiyer16 <https://github.com/hariiyer16> Is everything up-to-date
<https://yihui.name/en/2017/05/when-in-doubt-upgrade/> on the cluster?
e.g. Have you tried update.packages(ask = FALSE, checkBuilt = TRUE)?
devtools::session_info() and capabilities() will be helpful for
diagnostics.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1100 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABGsHuCwXmxscnVHlOE2nVz1xfLc8_zDks5tSge7gaJpZM4OY8LN>
.
|
@ndrubins If you use the latest version of rmarkdown (>= 1.8), it should not matter how R was installed or run -- knitr will automatically check if |
Thanks
…On Wed, Feb 7, 2018 at 2:41 PM, Yihui Xie ***@***.***> wrote:
@ndrubins <https://github.com/ndrubins> If you use the latest version of
rmarkdown (>= 1.8), it should not matter how R was installed or run --
*knitr* will automatically check if png() works, and switch to svg() if
png() doesn't work.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1100 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABGsHoCrFf7naHLENnlU72p8Hx75iOjZks5tSiaNgaJpZM4OY8LN>
.
|
I think the solution to this mystery is that it is not enough to have cairo support for the |
Here to share my solution(actually yihui's) to compile the Rmd file in a server without X11 capability. My setup code:
My school cluster's headless R Capabilities:
|
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
Hi there,
I'm trying to run an
Rmarkdown
script from the command line on my linux cluster, that will generate an html report, using this command:R -e "rmarkdown::render('script.Rmd',output_file='output.html')"
I don't have
X11
installed on my cluster nodes which caused it to crash so the solution was to installxvfb
, and I'm now running it with this command:xvfb-run --server-args="-screen 0 1024x768x24 -noreset" R -e "rmarkdown::render('script.Rmd',output_file='output.html')"
While it doesn't crash immediately anymore,
xvfb
hasRAM
usage issues, which I thought would be solved by adding the-noreset
argument, but unfortunately that's not the case, and it still occasionally seq faults and crashes when it's out ofRAM
.So my question is if there's an alternative way to solve this? Perhaps it is possible to build the
Rmarkdown
package without the dependence on X11?The text was updated successfully, but these errors were encountered: