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:
The ? operator overrides any other ? dynamic operators when the RProvider.Operators module is opened. I have not been able to figure out a way of preventing this, as I run into issues as discussed in https://github.com/dotnet/fsharp/pull/6805#issuecomment-601866624
Use of the name SymbolicExpression may not be beginner-friendly.
Types of changes
What types of changes does your code introduce to RProvider?
Put an x in the boxes that apply
[ ] Bugfix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
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.
[x] Build and tests pass locally
[x] I have added tests that prove my fix is effective or that my feature works (if appropriate)
[x] I have added necessary documentation (if appropriate)
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 anOperators
module containing a dynamic operator for accessing list / S4 objects based on work in #50 and #63: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:
SymbolicExpression
may not be beginner-friendly.Types of changes
What types of changes does your code introduce to RProvider? Put an
x
in the boxes that applyChecklist
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