How to open .R files (R scripts) on Android, Windows and Linux
What .r, .jl, .ex, .erl, .clj, .hs and .ml files are and how to open and edit R, Julia, Elixir, Haskell and more for free on Android, Windows and Linux.

Your statistics tutor shares analysis.R, a research paper links its Julia code, or you’re curious about the Haskell exercises from a functional programming course. Without RStudio or the right compiler, the file won’t open on your phone, and Windows doesn’t recognise it either.
All of these are plain-text source files. Folders opens R, Julia, Elixir, Erlang, Clojure, Haskell, Elm, F# and OCaml files in its text editor on Android, Windows and Linux, so you can read the code, search it and make small changes.
What is a .r file?
A .r (or .R) file is a script in R, the language statisticians and data scientists use for analysis and charts. It grew out of the S language from Bell Labs and is free and open source. An R script is a list of commands: load a data file, fit a model, draw a plot.
R’s results are often saved separately, in .RData and .rds files. Those are binary data, not text; only the .R scripts are code you can read.
This guide also covers languages popular in research, finance and telecoms, many of them functional (built around functions and values rather than changing variables):
| Extension | Language or format | What it’s for |
|---|---|---|
.r |
R | Statistics, data analysis and charts |
.jl |
Julia | Fast numerical and scientific computing |
.ex |
Elixir | Modules compiled into an app (Phoenix web apps, for example) |
.exs |
Elixir script | Scripts run directly: tests, config, mix.exs project files |
.erl |
Erlang | Source code for fault-tolerant systems, first built at Ericsson for telephone switches |
.hrl |
Erlang header | Records and macros shared between Erlang files |
.clj |
Clojure | A Lisp that runs on the Java Virtual Machine |
.cljs |
ClojureScript | Clojure that compiles to JavaScript |
.edn |
EDN (Extensible Data Notation) | Clojure’s data format, used for config such as deps.edn |
.hs |
Haskell | A pure functional language, built with the GHC compiler |
.elm |
Elm | A functional language for web front ends that compiles to JavaScript |
.fs |
F# | Microsoft’s functional language for .NET |
.fsx |
F# script | F# run directly as a script, with dotnet fsi |
.ml |
OCaml | Source code; OCaml comes from France’s INRIA research institute |
.mli |
OCaml interface | The public signatures of a matching .ml file |
Elixir and Erlang share a runtime, the BEAM virtual machine, so Elixir code can call Erlang libraries directly.
How to open a .r file with Folders
On Android
- Download Folders from the download section and install it. Your phone needs Android 7.0 or newer.
- Open it and tap Allow access, then allow All files access.
- Browse to the file, or use the search box. Course files usually land in Downloads.
- Tap the file to open it in the text editor.
If the script came by email or chat, tap the attachment and choose Open with → Folders. Code shared as a ZIP opens in Folders like a folder.
On Windows and Linux
- Install Folders: the setup program on Windows, or deb, rpm, AppImage, Flatpak, Snap or tar.gz on Linux.
- Browse to the file in Folders and double-click it.
- On Windows, Folders is also listed in File Explorer’s Open with menu for these types. Right-click the file and choose Open with → Folders.
What you can do with it in Folders
- Highlighting where Folders knows the language. R, Julia and Elixir files get colours for
#comments, strings, numbers and keywords. Haskell and Elm get colouring for--comments, strings and keywords such aswhere,let,dataandmodule. - Plain text with line numbers for the rest. Erlang, Clojure, EDN, F# and OCaml files open without colours, but with line numbers and every other tool below.
- Go to line. An R error points at a line in your script, and GHC reports
Main.hs:23:5: error. Go to line takes you there. - Find and Find and replace, with Match case, to rename a variable or find where a function is used.
- Edit and Save, with undo and redo, word wrap, and smaller or larger text for reading on a phone.
- Tabs, so an OCaml
.mlfile and its.mliinterface, or an Erlang file and its.hrlheader, can stay open side by side. - Document info with the line and column, the encoding and the line endings.
Folders doesn’t run R or any other language here, and it doesn’t draw plots, evaluate code or type-check it.
Other ways to open .r files
- RStudio or Positron from Posit, for R; both are free desktop IDEs.
- Visual Studio Code with an extension for the language: Julia, ElixirLS, Ionide for F#, OCaml Platform, Calva for Clojure, and Haskell’s extension.
- The language’s own tools:
Rscript analysis.R,julia script.jl,elixir script.exs,ghcifor Haskell,dotnet fsifor F# scripts,utopfor OCaml.
Problems opening a .r file?
- Your
.RDataor.rdsfile looks like gibberish. It’s saved R data in a binary format, not a script. Load it in R withload()orreadRDS(). - A script works on Windows but not on Linux. Windows ignores upper and lower case in file names; Linux doesn’t. If the code says
source("Helpers.R")and the file ishelpers.R, it fails on Linux. Rename the file in Folders or fix the line. - A
.fsfile isn’t F#. Graphics projects sometimes use.fsfor OpenGL fragment shaders. If it starts with#version, it’s a shader. Either way, it opens as text. - The script needs files you don’t have. R scripts load their data by path, with lines like
read.csv("data/survey.csv"). If you were sent only the script, Findread.orload(to see which data files to ask for.
Questions people ask
How do I open an R file without RStudio? It’s a text file, so any text editor shows it. Folders opens it with highlighting on Android, Windows and Linux. To run it, you need R installed.
Can I open a .jl file on Android? Yes, to read and edit. Running Julia needs a computer with Julia installed.
.ex vs .exs: what’s the difference?
Both are Elixir. .ex files are compiled into the project; .exs files are scripts run directly, which is why tests and config use them.
What is an .edn file? Clojure’s data format, a bit like JSON but with keywords, sets and comments. It isn’t JSON, so JSON tools won’t read it.
For Python and Jupyter notebooks, see how to open .py files. For Ruby, Perl and Lua, read how to open .rb files. And here are all 382 file types Folders opens.
Keep reading
How to open .C files (C and C++ source code) on Android, Windows and Linux
What .c, .h and .cpp files are and how to open, read and edit C, C++ and Objective-C source code for free on Android, Windows and Linux, with no IDE needed.
How to open .CS files (C# source code) on Android, Windows and Linux
What .cs, .csproj, .sln, .vcxproj and .xaml files are and how to open and edit C# code and Visual Studio projects for free on Android, Windows and Linux.
How to open .CSS files (style sheets) on Android, Windows and Linux
What CSS, SCSS, Sass and Less files are and how to open, read and edit style sheets for free on Android, Windows and Linux, with colours, search and replace.



