Coder Social home page Coder Social logo

rprint and IO about rcall.jl HOT 6 CLOSED

juliainterop avatar juliainterop commented on June 2, 2024
rprint and IO

from rcall.jl.

Comments (6)

randy3k avatar randy3k commented on June 2, 2024

I have implemented something similar in the RCalling.jl. Check https://github.com/randy3k/RCalling.jl/blob/master/src/sexp.jl#L28

from rcall.jl.

simonbyrne avatar simonbyrne commented on June 2, 2024

Ah, great thanks!

from rcall.jl.

randy3k avatar randy3k commented on June 2, 2024

Just one more thing, my code does not capture STDERR, we should also do redirect_stderr!? (Somehow I have a feeling that the STDERR of R is re-directed to the STDOUT.)

EDIT:
I also discovered that the warning messages never print. They should be printed when a rprint function is triggered.

julia> using RCall

julia> rcall(:warning, "it is a warning");

julia> rprint("1")
[1] 1

from rcall.jl.

simonbyrne avatar simonbyrne commented on June 2, 2024

On my machine they appear at the end of the Julia session.

julia> using RCall

julia> rcall(:warning,"hello")
StrSxp(536870992,Ptr{Void} @0x00007fb514770978,Ptr{Void} @0x00007fb5191af5c8,Ptr{Ptr{None}} @0x00007fb5191af5f0,1,0)

julia>  quit()
Warning message:
hello 

from rcall.jl.

simonbyrne avatar simonbyrne commented on June 2, 2024

I've changed the IO, and fixed the warning problem in #59

from rcall.jl.

simonbyrne avatar simonbyrne commented on June 2, 2024

Looks like i was too ambitious: Rf_PrintWarnings doesn't work on linux (it's an unsupported function, but seems to work fine on Windows and OS X). Apparently we're not the only ones who want this, but it doesn't look like the r-dev team are in a hurry to fix it.

from rcall.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.