0

When I try to render an rmarkdown file with a ggplot image, all the chunks work that do not contain a ggplot image and it fails without an error when it tries to run said chunk.

The output I get in my terminal is

Killed 

It runs fine on my local machine with the latest version of R and all the packages updated.

Below is the environment I am using in docker to try to run the same thing (when it fails).

R version 3.4.1 (2017-06-30)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Amazon Linux AMI 2017.09

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] bindrcpp_0.2.2    blogdown_0.10     rmarkdown_1.11    here_0.1         
[5] PRROC_1.3.1       DT_0.5            forcats_0.3.0     
stringr_1.3.1    
[9] dplyr_0.7.8       purrr_0.2.5       readr_1.3.1       
tidyr_0.8.2      
[13] tibble_2.0.1      ggplot2_3.1.0     tidyverse_1.2.1   
data.table_1.12.0

loaded via a namespace (and not attached):
[1] Rcpp_1.0.0       lubridate_1.7.4  lattice_0.20-35  
assertthat_0.2.0
[5] rprojroot_1.3-2  digest_0.6.18    mime_0.6         R6_2.3.0        
[9] cellranger_1.1.0 plyr_1.8.4       backports_1.1.3  evaluate_0.12   
[13] httr_1.4.0       pillar_1.3.1     rlang_0.3.1      
lazyeval_0.2.1  
[17] readxl_1.2.0     rstudioapi_0.9.0 Matrix_1.2-10    
reticulate_1.10 
[21] htmlwidgets_1.3  munsell_0.5.0    shiny_1.2.0      broom_0.5.1     
[25] compiler_3.4.1   httpuv_1.4.5.1   modelr_0.1.2     xfun_0.4        
[29] pkgconfig_2.0.2  htmltools_0.3.6  tidyselect_0.2.5 crayon_1.3.4    
[33] withr_2.1.2      later_0.7.5      grid_3.4.1       nlme_3.1-131    
[37] jsonlite_1.6     xtable_1.8-3     gtable_0.2.0     magrittr_1.5    
[41] scales_1.0.0     cli_1.0.1        stringi_1.2.4     
promises_1.0.1  
[45] xml2_1.2.0       generics_0.0.2   tools_3.4.1      glue_1.3.0      
[49] hms_0.4.2        crosstalk_1.0.0  yaml_2.2.0       
colorspace_1.4-0
[53] rvest_0.3.2      knitr_1.21       bindr_0.1.1      haven_2.0.0     
Andrew Troiano
  • 187
  • 1
  • 8
  • It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). Share the smallest markdownfile that you can make that exhibits this error. How is your local machine different from the docker machine? – MrFlick Jan 23 '19 at 16:15
  • Yeah, it's hard because of the environment. I'll add something to my github and link it, my local environment is using R 3.5.1 and running on High Sierra, so I think it has to do with the version of R but not sure. – Andrew Troiano Jan 23 '19 at 16:20
  • After testing more, it's just plots in general. This example will fail in my docker container. https://github.com/atroiano/r_markdown_example – Andrew Troiano Jan 23 '19 at 16:22
  • How was R installed in that docker image? It sounds like the dependencies for the graphics devices probably aren't correct. It's likely not directly related to rmarkdown. Can you make plots with a "normal" R script on that image outside of rmarkdown? – MrFlick Jan 23 '19 at 16:39
  • wget R, the plots don't appear in my docker image when I try to run it. How should they appear when SSHed into a docker env? – Andrew Troiano Jan 23 '19 at 17:05
  • my bad yum install -y R is how I am installing R – Andrew Troiano Jan 23 '19 at 17:15
  • The full list of what I am yum installing is here ```yum install -y R openssl-devel libxml2 libcurl4-openssl-dev libcurl-devel libxml2-devel;``` – Andrew Troiano Jan 23 '19 at 17:41
  • I think everything is built right, I think the data isn't being populated correctly in my docker image, I don't know why it is different in docker vs my local PC, i'll post more when I figure it out. – Andrew Troiano Jan 23 '19 at 18:37

0 Answers0