I cannot copy and paste R code in the R runtime environment

The R runtime environment that is included with IBM® SPSS® Statistics does not allow copying and pasting on macOS operating systems without manual configuration.

Enabling copying and pasting in the R runtime environment

  1. Create an .Xdefaults file in your user home directory.
  2. Add the following line to the file.
    *VT100.translations: #override  Meta <KeyPress> V:  insert-selection(PRIMARY, CUT_BUFFER0)
  3. Enable the Update PRIMARY when Pasteboard changes setting in XQuartz (Preferences > Pasteboard).
  4. Quit and restart XQuartz.
    Note: For more information on XQuartz, see R runtime environment does not work in recent macOS versions.