The library installation involves three easy (famous last words) steps.

Configure R environment variables

The package needs to configure compiler flags for its dependency on EDF API library. Specifically, it needs to specify paths to include header files ( edf.h, edf_data.h, and edftypes.h) and to the library itself. The package will try to compile using sensible defaults for each platform, i.e., default installation paths for EyeLink Developers Kit v2.1.1. However, these defaults may change in the future or you may wish to install the library to a non-standard location (relevant primarily for Windows).

If compilation with default paths fails, you need to define R environment variables as described below. These variables must be defined either in user or project .Renviron file. The simplest way to edit it is via usethis library and edit_r_environ() function. Type usethis::edit_r_environ() for user and usethis::edit_r_environ('project') for projects environments (note that the latter shadows the former, read documentation for details). In the case of Windows, note that you do not need to worry about forward vs. backward slashes as R will normalize strings for you. Once you define the variables, restart session and check them by typing Sys.getenv() (to see all variables) or Sys.getenv("EDFAPI_INC") to check a specific one.


Default values assume that the EyeLink Developers Kit is installed in c:/Program Files (x86)/SR Research/EyeLink (default installation path).

Your .Renviron file include lines similar to the ones below

EDFAPI_LIB="c:/Program Files (x86)/SR Research/EyeLink/libs"
EDFAPI_LIB64="c:/Program Files (x86)/SR Research/EyeLink/libs/x64"
EDFAPI_INC="c:/Program Files (x86)/SR Research/EyeLink/Includes/eyelink"


Your .Renviron file should include a line like this


Mac OS

Your .Renviron file include lines similar to the ones below


Install the library

To install from github

install_github("alexander-pastukhov/eyelinkReader", dependencies=TRUE,  build_vignettes = TRUE)