Comments (4)
Hi Maxim
You are not missing anything obvious - I don't believe this works yet on
SymbolicExpressions that still live in the R world. It just hasn't been
implemented yet. We would be happy to review a patch to support this.
Of course, you can get the value as an array (using .Value/.GetValue()) and
slice that, but there is some overhead involved (copying the data from the
R data structure to a native .NET array). For what we do with R, that has
always been fine so far.
I think it's slightly tricky to support directly on the SymbolicExpression
just because you have to support the slice function on the container type
itself. The types we return directly are all from RDotNet, which is
implemented in C#. Supporting the slice operator on these requires a
change to RDotNet and creates a dependency on FSharp.Core. However, just
as you have to call specific functions to view the data as a numeric
vector, we could add to those so that you can view it as some sliceable
type...
Does that make sense?
Howard
On Fri, Nov 16, 2012 at 2:50 AM, Maxim Sokolov [email protected]:
I spent quite some time searching for any hints in the sources or docs for
a slice.I couldn't find it. As it is a key operation in R I would suggest adding
it.Do I miss something obvious?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/17.
from rprovider.
Thank you! Yeah, I think it is a good workaround (e.g. AsSlice(Nullable, Nullable, Nullable).
I also couldn't find how I can get generated variable names which are visible to R. When I want to generate expression which addresses variables from F# I have to do SetSymbol to assign them a name which I can use. Is there an easier way?
e.g.
let x = ....
x.Engine.SetSymbol("x", x)
let model = x.Engine.Evaluate("glmnet(x[,1:5], x[,6], family="binomial")")
It is not an idiomatic R code (more like matlab) but still.
I would love something like easy text expression generation for cases when there are no directly supported options:
let model = R.glmnet(x +! "[,1:5]", x +! "[,6",family="binomial")
Probably this also requires hacking RDotNet?
from rprovider.
Generally the idea is that you don't set symbols with specific names to be visible to R. They are visible if they are passed to functions, but they have generated names. Of course, this does have problems when the name of the variable is used by the function being called...
What exactly are you trying to do?
On Nov 21, 2012, at 8:00 AM, Maxim Sokolov [email protected] wrote:
Thank you! Yeah, I think it is a good workaround (e.g. AsSlice(Nullable, Nullable, Nullable).
I also couldn't find how I can get generated variable names which are visible to R. When I want to generate expression which addresses variables from F# I have to do SetSymbol to assign them a name which I can use. Is there an easier way?
e.g.
let x = ....
x.Engine.SetSymbol("x", x)
let model = x.Engine.Evaluate("glmnet(x[,1:5], x[,6], family="binomial")")It is not an idiomatic R code (more like matlab) but still.
I would love something like easy text expression generation for cases when there are no directly supported options:
let model = R.glmnet(x +! "[,1:5]", x +! "[,6",family="binomial")Probably this also requires hacking RDotNet?
—
Reply to this email directly or view it on GitHub.
from rprovider.
Not sure I understand the exact situation here, but supporting slicing on SymbolicExpression
sounds like a useful thing to add!
from rprovider.
Related Issues (20)
- Implement recommended community standards HOT 1
- Revise documentation for .net 5 release HOT 3
- Release a R v3.5+ legacy version for .net framework use HOT 1
- Remove requirement for R_HOME environment variable to be set
- Graphics are unresponsive on Windows and macOS HOT 2
- [Windows only] RProvider doesn't work with R > 4.0.2 HOT 7
- Replace "." with "_" in library names for consistency. HOT 1
- The RPovider is now at https://fslab.org/RProvider/ HOT 5
- Plugins not working with 2.0 beta
- Server fails to start on Apple Silicon
- Project build when referencing RProvider hangs forever (ubuntu-latest - github actions) HOT 2
- FSI printing for R SymbolicExpressions missing since change to #r nuget HOT 5
- 'Permission Denied' in some Github Actions CI scripts but not others
- Check code formatting with fantomas
- Docs build problems on windows github action HOT 1
- No Docs for how to extract values from test summaries HOT 3
- Running an fsx script from "Reading and writing RData files" with fsi throws a `System.Reflection.TargetInvocationException` exception. HOT 3
- Add support for running on aarch64 architecture HOT 9
- Be aware of installation problems in the documentation and with R path HOT 2
- Cannot use the lsr package HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rprovider.