-5

I would like to start with R. I use macOS. And I saw on the website of R that is recommended (?) to install XQuartz, Xcode and Fortran before. However, I wonder what these 3 things are good for in relation to R? Do you really need them? Where are they specifically used and what do they do? Because in tutorials they are not installed. So should I install these programs before installing R?

Ian Bush
  • 6,996
  • 1
  • 21
  • 27
herry.23
  • 5
  • 1

1 Answers1

3

These tools are recommended because they are sometimes useful (and it may be easier to install them up front rather than suddenly realizing you need them in the middle of a project). They are not required for basic use of R.

From the R for MacOS web page [emphasis added]:

the use of X11 (including tcltk) requires XQuartz

  • X11 is an older window management system that some packages use
  • tcltk is an older tool that some packages use for presenting interactive buttons/widgets/etc.
  • you might need this for the rgl package, which renders interactive 3D graphics

If you wish to compile R packages which contain Fortran code, you may need to download the corresponding GNU Fortran compiler

Most R packages are available in a pre-compiled binary format, in which case you don't need XCode or gfortran. If you want to install development versions of packages (e.g. from someone's GitHub repository), and those packages contain compiled (C++ or Fortran) code, then you'll need XCode. Sometimes you'll see a message when installing packages about "binary available, but source is newer. Compile from source?". In this case it's usually safe to say "no".

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • Thank you very much! Even if my post was closed and I got downvotes. But I'm just an interested beginner and wanted to learn something. – herry.23 Aug 30 '23 at 15:20
  • I don't think the post really deserved all of those downvotes. You could argue that it's off-topic (but the specific close-vote reason doesn't really fit), but I think it's a reasonable question, and hope the answer will be useful to others. – Ben Bolker Aug 30 '23 at 17:57
  • Yes, that's right. Thank you. Helped me a lot! – herry.23 Sep 01 '23 at 15:49