Skip to content

Mutable vectors passed to R as mutable #416

Open
@djsamperi

Description

@djsamperi

Is your feature request related to a problem? Please describe.
One might expect that when a mutable vector is passed to a quasiquote, that the R code in the quasiquote can modify the vector. But this is not the case. The vector is passed by value.

Describe the solution you'd like
Since these mutable vectors on the Haskell side are actually proxies for R vectors, R should be able to work with
them just like it works with native R vectors.

Describe alternatives you've considered
Of course, we could simply copy out the vector as a list using fromList, but the point is to reduce the amount of copying.

Additional context
This would probably require some redesign of the Haskell/R interface because the current interface evaluates the
R expresion in a quasiquote by placing it into an R function parametrized by the input Haskell variables/vectors, and
vector parameters are passed by value in R (so the called function cannot change the input vector, mutable or not).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions