• Stars
    star
    235
  • Rank 164,730 (Top 4 %)
  • Language
    F#
  • License
    Other
  • Created almost 12 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Access R packages from F#

F# R Provider

Discord

RProvider

An F# type provider for interoperating with R. For more information, see detailed documentation with tutorials, examples and more. The following tutorials are a good place to start:

The R Provider discovers R packages that are available in your R installation and makes them available as .NET namespaces underneath the parent namespace RProvider. For example, the stats package is available as RProvider.stats. If you open the namespaces you want to use, functions and values will be available as R.name.


Builds

GitHub Actions
Github Actions

NuGet

Package Stable Prerelease
RProvider NuGet Badge NuGet Badge

Requirements

Make sure the following requirements are installed on your system:

  • dotnet SDK 5.0 or greater; and
  • R statistical language. Note: on Windows, there is currently a bug in R preventing us from supporting R versions greater than 4.0.2.
  • R_HOME environment variable set to the R home directory. This can usually be identified by running the command 'R RHOME'.

Note: for .NET framework support, you should use the legacy RProvider 1.2 or earlier; we are no longer supporting these versions.

What does it do?

The R Provider discovers R packages that are available in your R installation and makes them available as .NET namespaces underneath the parent namespace RProvider. For example, the stats package is available as RProvider.stats. If you open the namespaces you want to use, functions and values will be available as R.name. For example, consider this F# interactive script:

#r "nuget:RProvider"

open RProvider
open RProvider.``base``

let v = R.c(1,2,3)

This creates an R numeric vector containing 1,2,3, and names it v. Note that we had to open the base namespace, since the function 'c' is part of that namespace. You should also open namespace RProvider, because it contains some helper functions. As type providers are used by Visual Studio and other IDEs, you will get intellisense for R functions. You will also get compile-time type-checking that the function exists.

Note that you can set the version of RProvider to use (for reproducability) by changing the #r line to:

#r "nuget:RProvider,2.0.3" //replace 2.0.3 with desired version

How to use

RProvider is distributed as a NuGet package, which can be used from an F# script or F# projects. See our documentation for more detailed information and tutorials.

If you are using R 2.15 or later, you should not try to load the RProvider inside a script that is passed to FSI via the --use flag. It seems that something about the way R initializes causes it to hang in that context. Works fine if you load later.

Developing

Install the requirements listed in the above section. To build and test:

  1. Restore dotnet tools: dotnet tool restore
  2. Run FAKE: dotnet fake build -t All

To debug, enable logging by setting the RPROVIDER_LOG environment value to an existing text file.

License

RProvider is covered by the BSD license.

The library uses RDotNet which is also covered by the BSD license.

Maintainers

More Repositories

1

Deedle

Easy to use .NET library for data and time series manipulation and for scientific programming
F#
913
star
2

XPlot

A collection of older plotting libraries for F#. Recommended to use Plotly.NET instead https://plotly.net/
F#
286
star
3

flips

Fsharp LInear Programming System
F#
245
star
4

FSharp.Charting

Charting library suitable for interactive F# scripting
F#
216
star
5

FSharp.Stats

statistical testing, linear algebra, machine learning, fitting and signal processing in F#
F#
203
star
6

zzarchive-FsLab

A collection of packages for data science with F#
F#
159
star
7

Cytoscape.NET

.NET interface for Cytoscape.js written in F#
F#
44
star
8

FsLab

The curated FsLab stack and public discussion board for all things FsLab.
F#
26
star
9

zzarchive-Deedle.BigDemo

BigDeedle demo showing how to use Deedle for working with very large time series and data frames stored in Azure table storage.
F#
22
star
10

FsSpreadsheet

Spreadsheet creation and manipulation in F#, in a functional and/or object-oriented way.
F#
16
star
11

Graphoscope

A pragmatic approach to network science.
F#
13
star
12

fslaborg.github.io

The fslab website
F#
11
star
13

zzarchive-fslaborg.github.io

Project web site hosted at www.fslab.org
F#
10
star
14

NBFormat.NET

A pure F# library for parsing and converting the `.ipynb` notebook file format
F#
6
star
15

datasets

A data source for example datasets for all kinds of data science
6
star
16

zzarchive-FsLab.Templates

FsLab project templates - download as ZIP to get started!
4
star
17

docs-template

fslab documentation theme for FSharp.Formatting
F#
4
star
18

zzarchive-FsLab.Formatters

Scripts for formatting FsLab values (frames, charts, matrices, etc.) as HTML for Ionide and FsLab Journal
F#
3
star
19

Sigma.NET

.NET interface for sigma.js graph visualisation written in F#
F#
3
star
20

Fs-Tensor-Scratch

F#
2
star
21

conference-resources

Resources from the 2023 Data science in F# conference (and hopefully future iterations as well)
2
star
22

zzarchive-OReilly.Report

Source code for the "Analyzing and Visualizing Data with F#" report by O'Reilly
F#
2
star
23

project-template

A dotnet new template for creating streamlined datascience packages
1
star