MGHome page

GWAS course

Course map

0 of 64 steps done

Start with step 0.1Install R

Saved in this browser only.

Step 0.4

Module 0 · Prepare your computer · step 4 of 8

0.4Open the project and check R

Commands tested on Windows

In short

We open the course project and check that R can find its files. We display the system and R version, then try a small calculation to check that commands run.

Do this

You should see: [1] 5

Command

R command

Type or paste into the RStudio console.

1getwd()2stopifnot(file.exists("config.R"), file.exists("R/course.R"))3Sys.info()[c("sysname", "release", "machine")]4R.version.string52 + 3
  1. Note 1: Show the folder where R looks for files.
  2. Note 2: Check that the required project files exist.
  3. Note 3: Show the computer's system and processor information.
  4. Note 4: Show the installed R version.
  5. Note 5: Add two numbers to check that R runs commands.

You need

The complete extracted or cloned 2026 project from step 0.3, not one downloaded notebook. No branch change is needed.

What we do

Open the project, then open this notebook. Follow these actions:

  1. In the folder you extracted or cloned at step 0.3, double-click GWAS_course.Rproj. RStudio opens with the project. You should usually see the project name GWAS_course at the top right.
  2. In the Files pane, click the folder notebooks. Then click module_00_preparation.qmd. It opens in the editor. The file gwas_course_complete.qmd holds all modules in one notebook, if you prefer one file. The folder lessons holds the source files for the author. You do not need it.
  3. Run commands in the console. Always work from the project root (opens in a new tab), which is the main folder of the project.

Why

A relative path (opens in a new tab) gives the place of a file starting from the working directory. The working directory is the folder where R looks first. One project root means you never copy your personal full paths into commands.

Illustration in preparation

Alt text: Course project open in RStudio on Windows, with the lesson in Source beside Console and Files.

Illustration in preparation

Alt text: Course project open in RStudio on macOS, with the lesson in Source beside Console and Files.

Expected result

Show the expected result

R prints the path of your project folder. The file checks finish without an error. Your folder path will differ from the author's path.

R prints your system information, its version and the result [1] 5 from the small calculation. The R version may differ from the validation environment.

[1] 5

Verification: the project, version and calculation commands passed on Windows before this reordering.

If something goes wrong

If something goes wrong

If config.R is missing, close RStudio and open the project again from the extracted source folder. Do not create an empty replacement file. Do not rename a downloaded HTML page to .R.

Quick check

Does a relative path starting R/ refer to a folder on every computer's C drive?

Show the answer

No. It refers to the R folder under the current project root.

Files created

RStudio may create local project settings in .Rproj.user/. Git ignores them.