OA. free
Free
Exl Core Cs & Systems Data Science Medium

Which of the following is used to build and install R packages from source or repository?

Exl technical mcq question, verified with a worked answer. Free to practise - no sign-up.

Which of the following is used to build and install R packages from source or repository?

Choose one option.
Show answer & explanation
Answer: C. Rtools

Rtools is a collection of build tools (including a C/C++/Fortran compiler) required to compile R packages from source code on Windows, as R itself does not include a compiler.

Step-by-step Derivation:
Step 1: Analyze the requirement: The question asks for a tool used to 'build and install R packages from source'.
Step 2: Evaluate Option A (Contrib): 'contrib' is a directory within an R repository where pre-compiled binaries or source packages are stored; it is a storage location, not a build tool.
Step 3: Evaluate Option B (Base): 'base' refers to the core R package that contains the fundamental functions of the language; it is a library, not a build tool.
Step 4: Evaluate Option C (Rtools): Rtools provides the necessary toolchain (gcc, make, etc.) that allows R to compile C, C++, and Fortran code found in source packages. Without Rtools, users on Windows can only install pre-compiled binaries.
Step 5: Conclusion: Rtools is the correct utility for building packages from source.