# Fortran translations of many R packages

**URL:** https://fortran-lang.discourse.group/t/fortran-translations-of-many-r-packages/11076
**Category:** Announcements
**Created:** [August 31, 2026, 6:43pm UTC](https://fortran-lang.discourse.group/t/fortran-translations-of-many-r-packages/11076 "2026-08-31T18:43:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Beliavsky](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@Beliavsky](https://fortran-lang.discourse.group/u/Beliavsky)
#### Post date: [August 31, 2026, 6:43pm UTC](https://fortran-lang.discourse.group/t/fortran-translations-of-many-r-packages/11076/1 "2026-08-31T18:43:03Z")

</div>

There are more than 20,000 R packages, most of which import other R packages. You can ask ChatGPT on high or extra high mode to translate the computational algorithms of an R package, given a zip file of its code, to an FPM package, ignoring plotting, and provide translated packages for dependencies if they exist, and ChatGPT will do so in 10-20 minutes. When a package contains C, C++, or FORTRAN code, this is also translated to modern Fortran. If this is done in the chat interface it does not eat into the Codex quota. So far I have translated 490 R packages to FPM in the areas of

- [Time Series Analysis](https://github.com/Beliavsky/Fortran-from-R-packages/blob/main/TASK_VIEWS/TimeSeries.md)
- [Empirical Finance](https://github.com/Beliavsky/Fortran-from-R-packages/blob/main/TASK_VIEWS/Finance.md)
- [Missing Data](https://github.com/Beliavsky/Fortran-from-R-packages/blob/main/TASK_VIEWS/MissingData.md)
- [Optimization and Mathematical Programming](https://github.com/Beliavsky/Fortran-from-R-packages/blob/main/TASK_VIEWS/Optimization.md)
- [Numerical Mathematics](https://github.com/Beliavsky/Fortran-from-R-packages/blob/main/TASK_VIEWS/NumericalMathematics.md)
- [Probability Distributions](https://github.com/Beliavsky/Fortran-from-R-packages/blob/main/TASK_VIEWS/Distributions.md)

> **[GitHub - Beliavsky/Fortran-from-R-packages: Computational code from R packages translated to...](https://github.com/Beliavsky/Fortran-from-R-packages)**
>
> Computational code from R packages translated to Fortran

ChatGPT tests its translations against the R originals. I have looked at the results of the translation of the rugarch package myself, and they look correct, but in general the translations have not been verified by a human. In about 1/4 of cases ChatGPT asserts there is a flaw in the code of the R package that it has fixed in the translation. I need to review these assertions and report bugs to the maintainers of R packages. Once you have translated the algorithms of a package to Fortran it is straightforward to call the code from Python, Octave/Matlab, and R with a Fortran wrapper that uses explicit shape arrays (translations used assumed shape). This has been done for a few translations and will eventually be done for all. In about 100 tests of R vs. translated Fortran I saw a median speedup of a factor of 5.4. Since the LLM has access to the R code while translating, the translations inherit the license of the R code, which is usually GPL-2.0-or-later or GPL-3.0-only, and licenses are listed in the translations. Many packages share algorithms, some of which have been centralized in [shared modules](https://github.com/Beliavsky/Fortran-from-R-packages/blob/main/docs/SHARED_MODULES.md). I use and credit [`fortran-lapack`](https://github.com/perazz/fortran-lapack) of @FedericoPerini. Unlike Numerical Recipes, IMSL, or NAG, R packages are a decentralized set of codes, often contributed by professors as part of their research, so there is considerable overlap in R packages. I would like to create a comprehensive Fortran library from the individual packages. Besides the areas listed above, there many packages in the following domains that would make sense to translate.

| [ActuarialScience](https://cran.r-project.org/web/views/ActuarialScience.html) | Actuarial Science |
| --- | --- |
| [AnomalyDetection](https://cran.r-project.org/web/views/AnomalyDetection.html) | Anomaly Detection |
| [Bayesian](https://cran.r-project.org/web/views/Bayesian.html) | Bayesian Inference |
| [CausalInference](https://cran.r-project.org/web/views/CausalInference.html) | Causal Inference |
| [ClinicalTrials](https://cran.r-project.org/web/views/ClinicalTrials.html) | Clinical Trial Design, Monitoring, Analysis and Reporting |
| [Cluster](https://cran.r-project.org/web/views/Cluster.html) | Cluster Analysis & Finite Mixture Models |
| [CompositionalData](https://cran.r-project.org/web/views/CompositionalData.html) | Compositional Data Analysis |
| [DifferentialEquations](https://cran.r-project.org/web/views/DifferentialEquations.html) | Differential Equations |
| [Econometrics](https://cran.r-project.org/web/views/Econometrics.html) | Econometrics |
| [Environmetrics](https://cran.r-project.org/web/views/Environmetrics.html) | Analysis of Ecological and Environmental Data |
| [Epidemiology](https://cran.r-project.org/web/views/Epidemiology.html) | Epidemiology |
| [ExperimentalDesign](https://cran.r-project.org/web/views/ExperimentalDesign.html) | Design of Experiments (DoE) & Analysis of Experimental Data |
| [ExtremeValue](https://cran.r-project.org/web/views/ExtremeValue.html) | Extreme Value Analysis |
| [FunctionalData](https://cran.r-project.org/web/views/FunctionalData.html) | Functional Data Analysis |
| [GraphicalModels](https://cran.r-project.org/web/views/GraphicalModels.html) | Graphical Models |
| [Hydrology](https://cran.r-project.org/web/views/Hydrology.html) | Hydrological Data and Modeling |
| [MachineLearning](https://cran.r-project.org/web/views/MachineLearning.html) | Machine Learning & Statistical Learning |
| [MetaAnalysis](https://cran.r-project.org/web/views/MetaAnalysis.html) | Meta-Analysis |
| [MissingData](https://cran.r-project.org/web/views/MissingData.html) | Missing Data |
| [MixedModels](https://cran.r-project.org/web/views/MixedModels.html) | Mixed, Multilevel, and Hierarchical Models in R |
| [NetworkAnalysis](https://cran.r-project.org/web/views/NetworkAnalysis.html) | Network Analysis |
| [Omics](https://cran.r-project.org/web/views/Omics.html) | Genomics, Proteomics, Metabolomics, Transcriptomics, and Other Omics |
| [Pharmacokinetics](https://cran.r-project.org/web/views/Pharmacokinetics.html) | Analysis of Pharmacokinetic Data |
| [Phylogenetics](https://cran.r-project.org/web/views/Phylogenetics.html) | Phylogenetics |
| [Psychometrics](https://cran.r-project.org/web/views/Psychometrics.html) | Psychometric Models and Methods |
| [Robust](https://cran.r-project.org/web/views/Robust.html) | Robust Statistical Methods |
| [Spatial](https://cran.r-project.org/web/views/Spatial.html) | Analysis of Spatial Data |
| [SpatioTemporal](https://cran.r-project.org/web/views/SpatioTemporal.html) | Handling and Analyzing Spatio-Temporal Data |
| [Survival](https://cran.r-project.org/web/views/Survival.html) | Survival Analysis |
| [Tracking](https://cran.r-project.org/web/views/Tracking.html) | Processing and Analysis of Tracking Data |
