Added 'key' to key variables for passing values to R.