bedatadriven / renjin

JVM-based interpreter for the R language for the statistical analysis.
https://www.renjin.org
GNU General Public License v2.0
513 stars 82 forks source link

capture.output() does not work properly #525

Open perNyfelt opened 3 years ago

perNyfelt commented 3 years ago

In GNU-R 3.5 the following code illustrates a simple use of capture.output:

> a <- capture.output(print("jabba"))
> print(a)
[1] "[1] \"jabba\""
> 

But in Renjin the same code results in

Renjin 3.5-beta76
Copyright (C) 2019 The R Foundation for Statistical Computing
Copyright (C) 2019 BeDataDriven
Falling back to pure JVM BLAS libraries.
> a <- capture.output(print("jabba"))
[1] "jabba"
> print(a)
character(0)
> 
  1. [1] "jabba" is unexpectedly being printed on the first line and
  2. character(0) being printed after the second line (the print command)

I.e. capture.output() is not able to capture the output.