Coder Social home page Coder Social logo

Comments (7)

nalimilan avatar nalimilan commented on June 10, 2024

Would an @R macro work? I suspect many R expressions are also valid Julia syntax, and that way one would benefit from syntax highlighting. Though it certainly makes sense to have a non-standard string literal, in particular if one wants to write several lines of R code using """.

from rcall.jl.

randy3k avatar randy3k commented on June 10, 2024

I suspect many R expressions are also valid Julia syntax, and....

I can list a number of exceptions

  1. list subset list$abc and list[["abc"]]
  2. variable names containing dots, e.g., obj.num1
  3. %*%, %%, %in%, etc and user defined operators.
  4. assignment <- and <<-

I believe that R_str with """ quote is much flexible than @R macro,

> R"""
f <- function(x){
   x^2
}
f(2)
"""

from rcall.jl.

simonbyrne avatar simonbyrne commented on June 10, 2024

I actually made a start on this on the rstr branch, currently unfinished. The idea was to support $ substitution whenever the $ was invalid in R, so that something like

R"sum(a$b)"

would be normal R syntax (looking up the b field of a, but

R"sum($b)"

would insert the Julia object b into the expression.

from rcall.jl.

dmbates avatar dmbates commented on June 10, 2024

Any further progress, Simon? I am running a workshop on "Julia for Statisticians" where RCall is extremely useful and would like to give a general prescription of

R"""
# your R code here
"""

from rcall.jl.

simonbyrne avatar simonbyrne commented on June 10, 2024

Not yet. I'm looking at some other RCall improvements, so I might try to see what I can do in the next few days.

from rcall.jl.

dmbates avatar dmbates commented on June 10, 2024

@simonbyrne Let me know if I can help in some way.

Would it be worthwhile dropping support for v0.3 in addition to other changes? That could simplify the inline documentation and allow for removal of some of the calls to @compat

from rcall.jl.

simonbyrne avatar simonbyrne commented on June 10, 2024

I was going to do that. I also want to get precompilation working.

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.