Closed tinoswe closed 9 years ago
I suppose you could get this to work using the R provider, but it sounds like a problem that would be better solved using the Deedle library, which is an F# implementation of data frames and lets you do something like this:
let v1 = [| "A"; "B"; "A" |]
let v2 = [| 1.14; 1.78; 1.13 |]
let v3 = [| 1.17; 1.12; 1.1 |]
let dataset =
frame [ "cat" =?> Series.ofValues v1
"v1" =?> Series.ofValues v2
"v2" =?> Series.ofValues v3 ]
dataset
|> Frame.filterRowValues (fun row -> row.GetAs "cat" = "A")
Deedle works nicely with the R provider, so you should be able to pass Deedle frames to R and vice versa.
If you need, for some reason, to do the data processing on the R side, then you'll have to convert the corresponding R code to use the R provider - which should be doable, but harder (if you have specific problem with doing that, then please open an issue with the problem details).
Many thanks Tomas. This was very helpful.
Hi all, I am trying to slice an R dataframe in F# but I am not able to find the solution... In the fsx test case that you find below I am trying to get values of column "v1" when "cat" = "A", i.e. 1.14 and 1.13.
Could you please help me? Many thanks in advance.