crsh / papaja

papaja (Preparing APA Journal Articles) is an R package that provides document formats to produce complete APA manuscripts from RMarkdown-files (PDF and Word documents) and helper functions that facilitate reporting statistics, tables, and plots.
https://frederikaust.com/papaja_man/
Other
651 stars 132 forks source link

Cannot Knit; error message #255

Closed oij11 closed 5 years ago

oij11 commented 5 years ago

Error: Failed to compile papajatest.tex. In addition: Warning message: In system2(..., stdout = FALSE, stderr = FALSE) : error in running command Execution halted

When I open a new markdown file with papaya template and try to knit the example, I get the error message as above. Could you help me resolve this?

image

crsh commented 5 years ago

Did you install a LaTeX distribution (e.g., TinyTeX, see manual for instructions)?

oij11 commented 5 years ago

Sorry, I had not seen the manual. However, even after installing pandoc and tinytex, I still cannot knit the markdown. The error message is :

Error running filter /Library/Frameworks/R.framework/Versions/3.5/Resources/library/papaja/rmd/ampersand_filter.R: Error in $: Failed reading: not a valid json value Error: pandoc document conversion failed with error 83 Execution halted

Could you help?

crsh commented 5 years ago

Hmm, are you just trying to knit the bare unedited template? Could you provide the output of devtools::session_info()?

oij11 commented 5 years ago

Yes. It was the bare unedited template. Here is the output of session_info:

> devtools::session_info()
─ Session info ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.5.0 (2018-04-23)
 os       macOS High Sierra 10.13.4   
 system   x86_64, darwin15.6.0        
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       America/Chicago             
 date     2018-12-11                  

─ Packages ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package        * version    date       lib source                           
 abind            1.4-5      2016-07-21 [1] CRAN (R 3.5.0)                   
 acepack          1.4.1      2016-10-29 [1] CRAN (R 3.5.0)                   
 AICcmodavg       2.1-1      2017-06-19 [1] CRAN (R 3.5.0)                   
 arm              1.10-1     2018-04-13 [1] CRAN (R 3.5.0)                   
 assertthat       0.2.0      2017-04-11 [1] CRAN (R 3.5.0)                   
 backports        1.1.2      2017-12-13 [1] CRAN (R 3.5.0)                   
 base64enc        0.1-3      2015-07-28 [1] CRAN (R 3.5.0)                   
 BayesFactor      0.9.12-4.2 2018-05-19 [1] CRAN (R 3.5.0)                   
 bayesplot        1.6.0      2018-08-02 [1] CRAN (R 3.5.0)                   
 BDgraph          2.53       2018-11-14 [1] CRAN (R 3.5.0)                   
 bindr            0.1.1      2018-03-13 [1] CRAN (R 3.5.0)                   
 bindrcpp       * 0.2.2      2018-03-29 [1] CRAN (R 3.5.0)                   
 bitops           1.0-6      2013-08-17 [1] CRAN (R 3.5.0)                   
 boot             1.3-20     2017-08-06 [1] CRAN (R 3.5.0)                   
 broom            0.5.1.9000 2018-12-06 [1] Github (tidymodels/broom@c5d85b4)
 callr            3.0.0      2018-08-24 [1] CRAN (R 3.5.0)                   
 car              3.0-2      2018-08-23 [1] CRAN (R 3.5.0)                   
 carData          3.0-2      2018-09-30 [1] CRAN (R 3.5.0)                   
 caTools          1.17.1.1   2018-07-20 [1] CRAN (R 3.5.0)                   
 cellranger       1.1.0      2016-07-27 [1] CRAN (R 3.5.0)                   
 checkmate        1.8.5      2017-10-24 [1] CRAN (R 3.5.0)                   
 cli              1.0.1      2018-09-25 [1] CRAN (R 3.5.0)                   
 cluster          2.0.7-1    2018-04-13 [1] CRAN (R 3.5.0)                   
 coda             0.19-2     2018-10-08 [1] CRAN (R 3.5.0)                   
 codetools        0.2-15     2016-10-05 [1] CRAN (R 3.5.0)                   
 colorspace       1.3-2      2016-12-14 [1] CRAN (R 3.5.0)                   
 colourpicker     1.0        2017-09-27 [1] CRAN (R 3.5.0)                   
 corpcor          1.6.9      2017-04-01 [1] CRAN (R 3.5.0)                   
 crayon           1.3.4      2017-09-16 [1] CRAN (R 3.5.0)                   
 crosstalk        1.0.0      2016-12-21 [1] CRAN (R 3.5.0)                   
 curl             3.2        2018-03-28 [1] CRAN (R 3.5.0)                   
 d3Network        0.5.2.1    2015-01-31 [1] CRAN (R 3.5.0)                   
 data.table       1.11.8     2018-09-30 [1] CRAN (R 3.5.0)                   
 desc             1.2.0      2018-05-01 [1] CRAN (R 3.5.0)                   
 DescTools        0.99.26    2018-11-13 [1] CRAN (R 3.5.0)                   
 devtools         2.0.1      2018-10-26 [1] CRAN (R 3.5.0)                   
 digest           0.6.18     2018-10-10 [1] CRAN (R 3.5.0)                   
 dplyr          * 0.7.8      2018-11-10 [1] CRAN (R 3.5.0)                   
 DT               0.5        2018-11-05 [1] CRAN (R 3.5.0)                   
 dygraphs         1.1.1.6    2018-07-11 [1] CRAN (R 3.5.0)                   
 ellipse          0.4.1      2018-01-05 [1] CRAN (R 3.5.0)                   
 emmeans          1.3.0      2018-10-26 [1] CRAN (R 3.5.0)                   
 estimability     1.3        2018-02-11 [1] CRAN (R 3.5.0)                   
 evaluate         0.12       2018-10-09 [1] CRAN (R 3.5.0)                   
 expm             0.999-3    2018-09-22 [1] CRAN (R 3.5.0)                   
 fansi            0.4.0      2018-10-05 [1] CRAN (R 3.5.0)                   
 fdrtool          1.2.15     2015-07-08 [1] CRAN (R 3.5.0)                   
 forcats        * 0.3.0      2018-02-19 [1] CRAN (R 3.5.0)                   
 foreign        * 0.8-71     2018-07-20 [1] CRAN (R 3.5.0)                   
 Formula          1.2-3      2018-05-03 [1] CRAN (R 3.5.0)                   
 fs               1.2.6      2018-08-23 [1] CRAN (R 3.5.0)                   
 gdata            2.18.0     2017-06-06 [1] CRAN (R 3.5.0)                   
 generics         0.0.2      2018-12-06 [1] Github (r-lib/generics@d59e6b4)  
 ggcorrplot       0.1.2      2018-09-11 [1] CRAN (R 3.5.0)                   
 ggm              2.3        2015-01-21 [1] CRAN (R 3.5.0)                   
 ggplot2        * 3.1.0      2018-10-25 [1] CRAN (R 3.5.0)                   
 ggridges         0.5.1      2018-09-27 [1] CRAN (R 3.5.0)                   
 glasso           1.10       2018-07-13 [1] CRAN (R 3.5.0)                   
 glue             1.3.0      2018-07-17 [1] CRAN (R 3.5.0)                   
 gplots           3.0.1      2016-03-30 [1] CRAN (R 3.5.0)                   
 gridExtra        2.3        2017-09-09 [1] CRAN (R 3.5.0)                   
 gtable           0.2.0      2016-02-26 [1] CRAN (R 3.5.0)                   
 gtools           3.8.1      2018-06-26 [1] CRAN (R 3.5.0)                   
 gvlma            1.0.0.2    2014-01-21 [1] CRAN (R 3.5.0)                   
 haven          * 2.0.0      2018-11-22 [1] CRAN (R 3.5.0)                   
 Hmisc            4.1-1      2018-01-03 [1] CRAN (R 3.5.0)                   
 hms              0.4.2      2018-03-10 [1] CRAN (R 3.5.0)                   
 htmlTable        1.12       2018-05-26 [1] CRAN (R 3.5.0)                   
 htmltools        0.3.6      2017-04-28 [1] CRAN (R 3.5.0)                   
 htmlwidgets      1.3        2018-09-30 [1] CRAN (R 3.5.0)                   
 httpuv           1.4.5      2018-07-19 [1] CRAN (R 3.5.0)                   
 httr             1.3.1      2017-08-20 [1] CRAN (R 3.5.0)                   
 huge             1.2.7      2015-09-16 [1] CRAN (R 3.5.0)                   
 igraph           1.2.2      2018-07-27 [1] CRAN (R 3.5.0)                   
 inline           0.3.15     2018-05-18 [1] CRAN (R 3.5.0)                   
 jpeg             0.1-8      2014-01-23 [1] CRAN (R 3.5.0)                   
 jsonlite         1.5        2017-06-01 [1] CRAN (R 3.5.0)                   
 KernSmooth       2.23-15    2015-06-29 [1] CRAN (R 3.5.0)                   
 knitr            1.20       2018-02-20 [1] CRAN (R 3.5.0)                   
 later            0.7.5      2018-09-18 [1] CRAN (R 3.5.0)                   
 lattice          0.20-38    2018-11-04 [1] CRAN (R 3.5.0)                   
 latticeExtra     0.6-28     2016-02-09 [1] CRAN (R 3.5.0)                   
 lavaan           0.6-3      2018-09-22 [1] CRAN (R 3.5.0)                   
 lazyeval         0.2.1      2017-10-29 [1] CRAN (R 3.5.0)                   
 lme4           * 1.1-19     2018-11-10 [1] CRAN (R 3.5.0)                   
 lmerTest       * 3.0-1      2018-04-23 [1] CRAN (R 3.5.0)                   
 lmSupport      * 2.9.13     2018-04-08 [1] CRAN (R 3.5.0)                   
 loo              2.0.0      2018-04-11 [1] CRAN (R 3.5.0)                   
 lubridate        1.7.4      2018-04-11 [1] CRAN (R 3.5.0)                   
 magrittr       * 1.5        2014-11-22 [1] CRAN (R 3.5.0)                   
 manipulate       1.0.1      2014-12-24 [1] CRAN (R 3.5.0)                   
 markdown         0.8        2017-04-20 [1] CRAN (R 3.5.0)                   
 MASS             7.3-51.1   2018-11-01 [1] CRAN (R 3.5.0)                   
 Matrix         * 1.2-15     2018-11-01 [1] CRAN (R 3.5.0)                   
 matrixcalc       1.0-3      2012-09-15 [1] CRAN (R 3.5.0)                   
 MatrixModels     0.4-1      2015-08-22 [1] CRAN (R 3.5.0)                   
 matrixStats      0.54.0     2018-07-23 [1] CRAN (R 3.5.0)                   
 memoise          1.1.0      2017-04-21 [1] CRAN (R 3.5.0)                   
 mi               1.0        2015-04-16 [1] CRAN (R 3.5.0)                   
 mime             0.6        2018-10-05 [1] CRAN (R 3.5.0)                   
 miniUI           0.1.1.1    2018-05-18 [1] CRAN (R 3.5.0)                   
 minqa            1.2.4      2014-10-09 [1] CRAN (R 3.5.0)                   
 mnormt           1.5-5      2016-10-15 [1] CRAN (R 3.5.0)                   
 modelr           0.1.2      2018-05-11 [1] CRAN (R 3.5.0)                   
 multcomp         1.4-8      2017-11-08 [1] CRAN (R 3.5.0)                   
 MuMIn            1.42.1     2018-07-23 [1] CRAN (R 3.5.0)                   
 munsell          0.5.0      2018-06-12 [1] CRAN (R 3.5.0)                   
 mvtnorm          1.0-8      2018-05-31 [1] CRAN (R 3.5.0)                   
 network          1.13.0.1   2018-04-02 [1] CRAN (R 3.5.0)                   
 nFactors         2.3.3      2011-12-20 [1] CRAN (R 3.5.0)                   
 nlme             3.1-137    2018-04-07 [1] CRAN (R 3.5.0)                   
 nloptr           1.2.1      2018-10-03 [1] CRAN (R 3.5.0)                   
 nnet             7.3-12     2016-02-02 [1] CRAN (R 3.5.0)                   
 numDeriv         2016.8-1   2016-08-27 [1] CRAN (R 3.5.0)                   
 openxlsx         4.1.0      2018-05-26 [1] CRAN (R 3.5.0)                   
 papaja           0.1.0.9842 2018-12-06 [1] Github (crsh/papaja@2e11aec)     
 pbapply          1.3-4      2018-01-10 [1] CRAN (R 3.5.0)                   
 pbivnorm         0.6.0      2015-01-23 [1] CRAN (R 3.5.0)                   
 pbkrtest         0.4-7      2017-03-15 [1] CRAN (R 3.5.0)                   
 pillar           1.3.0      2018-07-14 [1] CRAN (R 3.5.0)                   
 pkgbuild         1.0.2      2018-10-16 [1] CRAN (R 3.5.0)                   
 pkgconfig        2.0.2      2018-08-16 [1] CRAN (R 3.5.0)                   
 pkgload          1.0.2      2018-10-29 [1] CRAN (R 3.5.0)                   
 plyr             1.8.4      2016-06-08 [1] CRAN (R 3.5.0)                   
 png              0.1-7      2013-12-03 [1] CRAN (R 3.5.0)                   
 ppcor            1.1        2015-12-03 [1] CRAN (R 3.5.0)                   
 prettyunits      1.0.2      2015-07-13 [1] CRAN (R 3.5.0)                   
 processx         3.2.1      2018-12-05 [1] CRAN (R 3.5.0)                   
 promises         1.0.1      2018-04-13 [1] CRAN (R 3.5.0)                   
 ps               1.2.1      2018-11-06 [1] CRAN (R 3.5.0)                   
 psych            1.8.10     2018-10-31 [1] CRAN (R 3.5.0)                   
 psycho         * 0.3.7      2018-09-13 [1] CRAN (R 3.5.0)                   
 purrr          * 0.2.5      2018-05-29 [1] CRAN (R 3.5.0)                   
 pwr              1.2-2      2018-03-03 [1] CRAN (R 3.5.0)                   
 qgraph           1.5        2018-04-25 [1] CRAN (R 3.5.0)                   
 R6               2.3.0      2018-10-04 [1] CRAN (R 3.5.0)                   
 raster           2.8-4      2018-11-03 [1] CRAN (R 3.5.0)                   
 RColorBrewer     1.1-2      2014-12-07 [1] CRAN (R 3.5.0)                   
 Rcpp             1.0.0      2018-11-07 [1] CRAN (R 3.5.0)                   
 readr          * 1.2.1      2018-11-22 [1] CRAN (R 3.5.0)                   
 readxl           1.1.0      2018-04-20 [1] CRAN (R 3.5.0)                   
 remotes          2.0.2      2018-10-30 [1] CRAN (R 3.5.0)                   
 reshape          0.8.8      2018-10-23 [1] CRAN (R 3.5.0)                   
 reshape2         1.4.3      2017-12-11 [1] CRAN (R 3.5.0)                   
 rio              0.5.16     2018-11-26 [1] CRAN (R 3.5.0)                   
 rjson            0.2.20     2018-06-08 [1] CRAN (R 3.5.0)                   
 rlang            0.3.0.1    2018-10-25 [1] CRAN (R 3.5.0)                   
 rmarkdown        1.10       2018-06-11 [1] CRAN (R 3.5.0)                   
 rpart            4.1-13     2018-02-23 [1] CRAN (R 3.5.0)                   
 rprojroot        1.3-2      2018-01-03 [1] CRAN (R 3.5.0)                   
 rsconnect        0.8.12     2018-12-05 [1] CRAN (R 3.5.0)                   
 rstan            2.18.2     2018-11-07 [1] CRAN (R 3.5.0)                   
 rstanarm         2.18.2     2018-11-10 [1] CRAN (R 3.5.0)                   
 rstantools       1.5.1      2018-08-22 [1] CRAN (R 3.5.0)                   
 rstudioapi       0.8        2018-10-02 [1] CRAN (R 3.5.0)                   
 rvest            0.3.2      2016-06-17 [1] CRAN (R 3.5.0)                   
 sandwich         2.5-0      2018-08-17 [1] CRAN (R 3.5.0)                   
 scales           1.0.0      2018-08-09 [1] CRAN (R 3.5.0)                   
 sem              3.1-9      2017-04-24 [1] CRAN (R 3.5.0)                   
 sessioninfo      1.1.1      2018-11-05 [1] CRAN (R 3.5.0)                   
 shiny            1.2.0      2018-11-02 [1] CRAN (R 3.5.0)                   
 shinyjs          1.0        2018-01-08 [1] CRAN (R 3.5.0)                   
 shinystan        2.5.0      2018-05-01 [1] CRAN (R 3.5.0)                   
 shinythemes      1.1.2      2018-11-06 [1] CRAN (R 3.5.0)                   
 sna              2.4        2016-08-08 [1] CRAN (R 3.5.0)                   
 sp               1.3-1      2018-06-05 [1] CRAN (R 3.5.0)                   
 StanHeaders      2.18.0     2018-10-07 [1] CRAN (R 3.5.0)                   
 statnet.common   4.1.4      2018-06-22 [1] CRAN (R 3.5.0)                   
 stringi          1.2.4      2018-07-20 [1] CRAN (R 3.5.0)                   
 stringr        * 1.3.1      2018-05-10 [1] CRAN (R 3.5.0)                   
 survival         2.43-3     2018-11-26 [1] CRAN (R 3.5.0)                   
 testthat         2.0.1      2018-10-13 [1] CRAN (R 3.5.0)                   
 TH.data          1.0-9      2018-07-10 [1] CRAN (R 3.5.0)                   
 threejs          0.3.1      2017-08-13 [1] CRAN (R 3.5.0)                   
 tibble         * 1.4.2      2018-01-22 [1] CRAN (R 3.5.0)                   
 tidyr          * 0.8.2      2018-10-28 [1] CRAN (R 3.5.0)                   
 tidyselect       0.2.5      2018-10-11 [1] CRAN (R 3.5.0)                   
 tidyverse      * 1.2.1      2017-11-14 [1] CRAN (R 3.5.0)                   
 tinytex        * 0.9        2018-10-23 [1] CRAN (R 3.5.0)                   
 unmarked         0.12-2     2017-05-15 [1] CRAN (R 3.5.0)                   
 usethis          1.4.0      2018-08-14 [1] CRAN (R 3.5.0)                   
 utf8             1.1.4      2018-05-24 [1] CRAN (R 3.5.0)                   
 VGAM             1.0-6      2018-08-18 [1] CRAN (R 3.5.0)                   
 whisker          0.3-2      2013-04-28 [1] CRAN (R 3.5.0)                   
 withr            2.1.2      2018-03-15 [1] CRAN (R 3.5.0)                   
 xfun             0.4        2018-10-23 [1] CRAN (R 3.5.0)                   
 xml2             1.2.0      2018-01-24 [1] CRAN (R 3.5.0)                   
 xtable           1.8-3      2018-08-29 [1] CRAN (R 3.5.0)                   
 xts              0.11-2     2018-11-05 [1] CRAN (R 3.5.0)                   
 yaml           * 2.2.0      2018-07-25 [1] CRAN (R 3.5.0)                   
 zip              1.0.0      2017-04-25 [1] CRAN (R 3.5.0)                   
 zoo              1.8-4      2018-09-19 [1] CRAN (R 3.5.0)                   

[1] /Library/Frameworks/R.framework/Versions/3.5/Resources/library

Thanks,

crsh commented 5 years ago

Could you try installing the development version (devtools::install_github("crsh/papaja")) to see if that helps? As a quick fix you should be able to circumvent this issue by adding replace_ampersands: no to the YAML front matter.

oij11 commented 5 years ago

Thanks, the quick fix worked. I tried resinstalling papaja; it asked whether to update other packages so I chose All. Then, it showed an error as below and stopped. It seems that the issue has to do with broom package (which was also the case when I first tried to install papaja...) but I have no idea how to fix it.

crsh commented 5 years ago

From googeling it seems this is a macOS-specific issue. Have a look at the discussion in this issue and the suggested solutions.

oij11 commented 5 years ago

Ok. So I tried the solutions and successfully installed the development version of papaja. However, I still can't knit the unedited template and get the exactly same error.  

Error running filter /Library/Frameworks/R.framework/Versions/3.5/Resources/library/papaja/rmd/ampersand_filter.R: Error in $: Failed reading: not a valid json value Error: pandoc document conversion failed with error 83 Execution halted

oij11 commented 5 years ago

Not sure what created the error but the problem has gone after I reinstalled R and R studio (deleting all files just as Rprofile and history). Thanks

profgaelle commented 5 years ago

I had the same problem today (also using a Mac; upgraded RStudio, R is the latest version). Even files I had compiled before no longer worked today. Using the replace_ampersands: no in the preamble did the trick but I wonder: what does that do?

crsh commented 5 years ago

It's briefly explained in the manual. I have an idea how I might be able to fix this issue more reliably, but it'll be a while before I get around to it.

profgaelle commented 5 years ago

Thank you! Papaja is great!

On Fri, 12 Apr 2019 at 12:09, Frederik Aust notifications@github.com wrote:

It's briefly explained in the manual https://crsh.github.io/papaja_man/r-markdown-components.html#additional-rendering-options. I have an idea how I might be able to fix this issue more reliably, but it'll be a while before I get around to it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/crsh/papaja/issues/255#issuecomment-482519179, or mute the thread https://github.com/notifications/unsubscribe-auth/AmA2YHGm1zCnFbgEmhL3YuJTYE4Z1c2Zks5vgFtjgaJpZM4ZJcM_ .