fslaborg / RProvider

Access R packages from F#
http://fslab.org/RProvider/
Other
235 stars 69 forks source link

? operator and module for accessing slots / list members #256

Closed AndrewIOM closed 1 year ago

AndrewIOM commented 2 years ago

Proposed Changes

It is currently difficult to access properties of lists / S4 objects, usually requiring a reference to RDotNet and the use of dot notation.

This PR introduces a module SymbolicExpression that contains functions that allow R values to be used with forward piping in an F# style, and an Operators module containing a dynamic operator for accessing list / S4 objects based on work in #50 and #63:

open RProvider
open RProvider.datasets

R.mtcars
|> SymbolicExpression.column "mpg"

open RProvider.Operators

R.mtcars?mpg

The introduction of the module and operator, along with new documentation, should help to address #255 by removing the need to reference RDotNet explicitally.

Limitations:

Types of changes

What types of changes does your code introduce to RProvider? Put an x in the boxes that apply

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Further comments