knitr + R3.0.0: error in sum(figs) - knitr

Since the upgrade of R (2.15.1>3.0.0) I get an error when using knitr on file.Rhtml and also with Lyx.
The version of knitr is 1.1.
The error message is :
Erreur dans sum(figs) : 'type' (list) de l'argument incorrect
Calls: knit ... <Anonymous> -> process_group.block -> call_block -> block_exec
Any idea to solve this?
Alain

Update: knitr 1.2 is on CRAN now, in which this problem was fixed.
I think I have fixed this problem in the development version, which will be on CRAN soon. For now, please try
install.packages('knitr', repos = 'http://www.rforge.net/', type = 'source')

Related

Unable to generate exam with exams2moodle when including TikZ picture

I am trying to generate exams with exams2moodle on my new laptop. Everything worked (and still works) out perfectly fine on my old laptop, but in the new one (where I have exactly the same configuration, but there's obviously something missing), even when I try to run the simplest template with a TikZ figure in R/exams exams2moodle("automaton.Rnw") I get the error message
Error in magick_image_readpath(enc2native(path), density, depth,
strip, : rsession.exe: PDFDelegateFailed `El sistema no puede
encontrar el archivo especificado. ' # error/pdf.c/ReadPDFImage/809
I have checked my installation, and seen the various posts with similar problems, but haven't been able to fix it. Any idea what might be going wrong? Thank you very much in advance
EDIT: That's my session info
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)
Matrix products: default
locale:
[1] LC_COLLATE=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252 LC_MONETARY=Spanish_Spain.1252 LC_NUMERIC=C
[5] LC_TIME=Spanish_Spain.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] magick_2.4.0 mgsub_1.7.2 ICSNP_1.1-1 ICS_1.3-1 mvtnorm_1.1-1 plotrix_3.7-8
[7] Ryacas_1.1.3 FRACTION_1.0 stringr_1.4.0 Deriv_4.0.1 ggplot2_3.3.2 plot3D_1.3
[13] scatterplot3d_0.3-41 MASS_7.3-53 latex2exp_0.4.0 permute_0.9-5 mpoly_1.1.1 polynom_1.4-0
[19] pracma_2.2.9 numbers_0.7-5 exams_2.3-6
loaded via a namespace (and not attached):
[1] Rcpp_1.0.5 lattice_0.20-41 tidyr_1.1.2 assertthat_0.2.1 rprojroot_1.3-2 digest_0.6.25
[7] gmp_0.6-0 R6_2.4.1 plyr_1.8.6 backports_1.1.10 survey_4.0 evaluate_0.14
[13] pillar_1.4.6 rlang_0.4.7 misc3d_0.9-0 rstudioapi_0.11 Matrix_1.2-18 rmarkdown_2.3
[19] desc_1.2.0 splines_4.0.2 partitions_1.9-22 munsell_0.5.0 tinytex_0.26 compiler_4.0.2
[25] xfun_0.17 pkgconfig_2.0.3 htmltools_0.5.0 tcltk_4.0.2 mitools_2.4 tidyselect_1.1.0
[31] tibble_3.0.3 crayon_1.3.4 dplyr_1.0.2 withr_2.3.0 grid_4.0.2 gtable_0.3.0
[37] lifecycle_0.2.0 DBI_1.1.0 orthopolynom_1.0-5 magrittr_1.5 scales_1.1.1 stringi_1.5.3
[43] testthat_2.3.2 ellipsis_0.3.1 generics_0.0.2 vctrs_0.3.4 tools_4.0.2 glue_1.4.2
[49] purrr_0.3.4 pkgload_1.1.0 survival_3.1-12 colorspace_1.4-1 knitr_1.30
Overview
Thanks for carefully researching the problem and reporting it here. As you already worked out, the problem is not in the code within R/exams directly but with magick::image_read() which does not work correctly in some settings. Thanks also for reporting this to Jeroen Ooms, the magick maintainer.
Bug fix in magick
In response to the issue you filed, Jeroen has updated with the magick package on GitHub with new and updated ImageMagick binaries, see: https://github.com/ropensci/magick/pull/276. Please re-install magick from GitHub which should resolve the problem.
Workaround in exams
A potential workaround that avoids using magick could be to convert the TikZ PDF output to SVG instead of PNG. In that case pdf2svg (and pdfcrop) is needed to be on the PATH (see also the comments for further details). To try it use
exams2html("automaton.Rnw", svg = TRUE)
Or with exams2moodle() instead of exams2html(). (The latter is just easier for quickly inspecting the output.)
Links
Issue in the magick project on GitHub: https://github.com/ropensci/magick/issues/272.
Similar discussion in our R/exams forum on R-Forge: https://R-Forge.R-project.org/forum/forum.php?thread_id=34042&forum_id=4377&group_id=1337.

TYPO3 : Extension upgrade from version 7 to 9

I just updated my TYPO3 site from 7.6.x to 9.5.x and I get error with a custom extension :
Error :
Call to a member function exec_SELECTquery() on null
I think my plugin is not compatible with TYPO3 9.5.x.
The error come from this line :
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select, $table, $where, $groupBy, $orderBy, $limit);
How to edit this line to make it works with TYPO3 9.
With TYPO3 9 the database interface $GLOBALS['TYPO3_DB'] has beeen removed and the usage of doctrine-dbal is mandantory.
you can get more information along with some examples in the chapter about migration in the manual.

Error while processing event 'click': "SyntaxError: Unexpected token u\n

I am using basic features with MinkZombieDriver. my
node -v 5.2.0, npm -v 3.10.5, mink-zombie-driver v1.4.0 ..
behat.yml
default:
extensions:
Behat\MinkExtension:
base_url: 'https://example.com'
javascript_session: zombie
zombie:
node_modules_path: '/home/ubuntu/node_modules'
goutte: ~
paths:
features: features
bootstrap: %behat.paths.features%/bootstrap
I wrote simple feature and it is giving Behat\Mink\Exception\DriverException
#javascript
Scenario: View Products to assign store
Given I am on "/index.php" # FeatureContext::visit()
When I fill in "Username" with "hello" # FeatureContext::fillField()
When I fill in "Password" with "123" # FeatureContext::fillField()
And I should see "Manage Your Accounts" # FeatureContext::assertPageContainsText()
When I press "login_button" # FeatureContext::pressButton()
Error while processing event 'click': "SyntaxError: Unexpected token u\n at Object.parse (native)\n
I searched in the web but not sure how to solve. I am still using the basic default features. I know the problem is with JSON parsing .. I am not sure what I am doing wrong? I am looking forward for any suggestions.. Thanks ..
As is seems from my comment link you need to update zombie version to at least version 2.
Please note that you might have some compatibility issues that you will need to solve.
Check this answer also nodejs cannot find module 'zombie' with PHP mink

Unable to run jekyll

I use Github pages to host my websites,I have test it on my local machine, and it works well, but when I push my sites on Github, I got an error. It says
The page build failed with the following error:
unable to run jekyll
My _config.yml file
---
auto : false
lsi : false
pygments : true
permalink : none
markdown : maruku
maruku:
use_divs: true
use_tex: true
png_engine : blahtex
png_dir : images/latex/
png_url : /images/latex/
I have searched the web, but can't find any useful ideas. Who can help me?
I have resorted to Github, they sent me the log, here is the error:
Maruku: Using extended syntax for div elements.\nMaruku: Using LaTeX extension. Images in images/latex/.\n/var/lib/gems/1.8/gems/maruku-0.6.0/lib/maruku/ext/math/mathml_engines/blahtex.rb:40:in convert_to_png_blahtex': Blahtex error: empty output (RuntimeError)\n\tfrom /var/lib/gems/1.8/gems/maruku-0.6.0/lib/maruku/ext/math/to_html.rb:64:in send'\n\tfrom /var/lib/gems/1.8/gems/maruku-0.6.0/lib/maruku/ext/math/to_html.rb:64:in render_png'\n\tfrom /var/lib/gems/1.8/gems/maruku-0.6.0/lib/maruku/ext/math/to_html.rb:120:in to_html_equation'\n\tfrom /var/lib/gems/1.8/gems/maruku-0.6.0/lib/maruku/output/to_html.rb:970:in send'\n\tfrom /var/lib/gems/1.8/gems/maruku-0.6.0/lib/maruku/output/to_html.rb:970:in array_to_html'\n\tfrom /var/lib/gems/1.8/gems/maruku-0.6.0/lib/maruku/output/to_html.rb:961:in each'\n\tfrom /var/lib/gems/1.8/gems/maruku-0.6.0/lib/maruku/output/to_html.rb:961:in array_to_html'\n\tfrom /var/lib/gems/1.8/gems/maruku-0.6.0/lib/maruku/output/to_html.rb:956:in children_to_html'\n\tfrom /var/lib/gems/1.8/gems/maruku-0.6.0/lib/maruku/output/to_html.rb:50:in to_html'\n\tfrom /var/lib/gems/1.8/gems/jekyll-0.11.0/bin/../lib/jekyll/converters/markdown.rb:120:in convert'\n\tfrom /var/lib/gems/1.8/gems/jekyll-0.11.0/bin/../lib/jekyll/convertible.rb:46:in transform'\n\tfrom /var/lib/gems/1.8/gems/jekyll-0.11.0/bin/../lib/jekyll/convertible.rb:84:in do_layout'\n\tfrom /var/lib/gems/1.8/gems/jekyll-0.11.0/bin/../lib/jekyll/post.rb:189:in render'\n\tfrom /var/lib/gems/1.8/gems/jekyll-0.11.0/bin/../lib/jekyll/site.rb:193:in render'\n\tfrom /var/lib/gems/1.8/gems/jekyll-0.11.0/bin/../lib/jekyll/site.rb:192:in each'\n\tfrom /var/lib/gems/1.8/gems/jekyll-0.11.0/bin/../lib/jekyll/site.rb:192:in render'\n\tfrom /var/lib/gems/1.8/gems/jekyll-0.11.0/bin/../lib/jekyll/site.rb:40:in process'\n\tfrom /var/lib/gems/1.8/gems/jekyll-0.11.0/bin/jekyll:250\n\tfrom /var/lib/gems/1.8/bin/jekyll:19:in `load'\n\tfrom /var/lib/gems/1.8/bin/jekyll:19\n"
From the log, We can see the problem is `convert_to_png_blahtex': Blahtex error: empty output (RuntimeError). I read the blahtex code,
if png.name != 'png'
maruku_error "Blahtex error: \n#{doc}"
return nil
end
But, png files are there. Anyone has encountered this problem?
I'm not sure the _config.yml file is the problem. I've pushed an invalid one to my site and the pages still render fine. That said, try removing your _config.yml all together. Github pages work fine without it for me. If the page still fails to render, you know it's something else.
Don't use maruku
maruku hasnt had an update since June 2010.
Personally I prefer kramdown.

commands.py: name 'play_command' is not defined

I am new to Play and GWT and following the documentation given here. But I see the following errors:
bash-3.2$ play deps test-gwt
!! Error whileloading /opt/play-1.2.1/modules/gwt-1.0/commands.py: name 'play_command' is not defined
~
~ Resolving dependencies using /Users/Harit/Documents/personal/projects/test-gwt/conf/dependencies.yml,
~
~ play->gwt 1.0 (from playLocalModules)
~
~ Installing resolved dependencies,
~
~ modules/gwt-1.0 -> /opt/play-1.2.1/modules/gwt-1.0
~
~ Done!
I see that there is a corresponding bug here, and status is fix_commited, but I don't know what shall I do?
Isn't it just because play-gwt module is not compatible with play 1.2 ?
Apparently this module is quite old and not very active and command syntax has changed in version 1.1.x or something like that.
Before, you wrote commands.py like that:
...
if play_command.startswith('gwt:'):
...
and now, it is like that:
...
MODULE = "secure"
COMMANDS = ["secure:", "secure:ov", "secure:override"]
HELP = {
"secure:": "Show help for the secure module",
"secure:override": "Override the CSS, login or layout"
}
def execute(**kargs):
command = kargs.get("command")
app = kargs.get("app")
args = kargs.get("args")
env = kargs.get("env")
if command == 'secure:':
...
In my opinion, the modification is really light so you can either ask the module owner if he would accept to do it or even do it by yourself ;)
There is also a GWT2 module which seems much more active: http://www.playframework.org/modules/gwt2 (apparently no new version since last october but the github project shows very recent commits with play1.2 support)