HTML Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Mathematica vs. R

In brief

This repository has example projects, code, and documents for comparing Mathematica with R.

Mission statement

The development in this code repository aims to provide a collection of relatively simple but non-trivial example projects that illustrate the use of Mathematica and R in different statistical, machine learning, scientific, and software engineering programming activities.

Each of the projects has implementations and documents made with both Mathematica and R -- hopefully that would allow comparison and knowledge transfer.

License matters

All code files and executable documents are with the license GPL 3.0. For details see .

All documents are with the license Creative Commons Attribution 4.0 International (CC BY 4.0). For details see .

Projects organization

Each project has an introductory page ( that lists the project goals, concrete steps, and links to documents and scripts with full explanations and code.

Generally, an introductory page would also have sections with comparison observations and development history.

Each project (generally) has two directories named "Mathematica" and "R" that have corresponding documents and code.

Since Mathematica ships with R some projects would have only a Mathematica-centric exposition of combining Mathematica and R outputs into one Mathematica notebook.

Some projects have only Mathematica parts or only R parts. This is because there are no equivalent counter-parts.

There is an attempt the corresponding Mathematica and R codes to be very close in structure and steps flow. Often enough the structure and flow would be different because each programming language would make certain particular techniques easier to apply or because of certain language idioms.

Where to begin

This presentation, "Mathematica vs. R" given at the Wolfram Technology Conference 2015 is probably a good start.

This presentation, "Mathematica vs. R–Advanced Use Cases" was given at Wolfram Technology Conference 2016. Here are recorded videos:

As a warm-up of how to do the comparison see this mind-map (which is made for Mathematica users):


Projects overview

Abbreviations table

Abbreviation Definition   Abbreviation Definition
ARL Association rules learning   NA numerical analysis
BofW bag of words (model)   NLP natural language processing
Cl (machine learning) classification   Opt optimization
DA data analysis   Outl outliers
DIng data ingestion   Par parallel computing
Distr distributions of variables   QR quantile regression
DWrang data wrangling   Rgr regression
GoF goodness of fit   RLink Mathematica's RLink
Gr graphs   ROC receiver operating characteristic
HPC High Performance Computing   Sim simulation(s)
Img image processing   Str strings patterns and manipulation
IUI interactive user interface(s)   TS time series
LSA latent semantic analysis   Vis visualization
MF matrix factorization(s)      

Projects overview table

In the following table the projects in italics are partially completed -- they have only a Mathematica or an R part.

Project ARL BofW Cl DA DIng Distr DWrang GoF Gr Img IUI Rgr LSA MF NA NLP Opt Outl Par QR RLink ROC Sim Str TS Vis
BrowsingDataWithChernoffFaces X X X X X X
DataWrangling X X X X
DeepLearningExamples X X X X
DistributionExtractionAFromGaussianNoisedMixture X X X
HandwrittenDigitsClassificationByMatrixFactorization X X X X X X X
ODEsWithSeasonalities X X X X
ProgressiveJackpotModeling X X
ProgressiveMachineLearning X X X
RegressionWithROC X X X X
StatementsSaliencyInPodcasts X X X X X
TextAnalysisOfTrumpTweets X X X X X X X X X
TimeSeriesAnalysisWithQuantileRegression X X X X X X

Future projects

The future projects are listed in order of their completion time proximity -- the highest in the list would be committed the soonest.

Mathematica's RLink

For more information about Mathematica's RLink see