Ho scritto uno script in JMP che utilizza R per aiutare un cliente a ottenere alcune informazioni specifiche dal suo set di dati. Non avevano mai installato R prima, quindi li ho aiutati a installarlo (come ho fatto decine di volte). Il mio script genera un errore se JMP non riesce a trovare R sul computer (utilizza un'istruzione Throw(rconn = R Connect();,...)). JMP era in esecuzione quando è stato installato R, ho eseguito lo script e non è riuscito a trovare R. Ho chiuso JMP, l'ho riavviato: stesso errore. Ho riavviato il computer, eseguito lo script: stesso errore. Ho disinstallato R, chiuso JMP, installato R, avviato JMP: stesso errore. Quindi, quello che mi chiedo è: posso aiutare JMP a trovare R specificando la destinazione? I file di supporto JMP dicono:
How JMP Finds R
JMP delays loading R until a JSL-based script requires access to it. When JMP needs to load R, it follows the standard steps for finding R on a Windows computer:
1.Look up the environment variable R_HOME.
If the variable exists, load R from the specified directory.
2.If the environment variable R_HOME does not exist, look up the InstallPath value in the Windows registry under the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\R-core\R
For 32-bit JMP running on a 64-bit machine, the InstallPath value is under the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE\R-core\R
If the InstallPath value exists, load R from the specified directory.
3.If the InstallPath value does not exist, an error message states that R could not be found.
Posso specificare la variabile d'ambiente R_HOME o passare il valore InstallPath?
Si è scoperto che la soluzione era che l'utente non aveva privilegi amministrativi sul computer (sembrava che li avesse perché poteva installare R). Una volta disinstallato R, richiesto i diritti amministrativi e reinstallato R, tutto ha funzionato correttamente.
Vorrei sottolineare che ulteriori indagini hanno rivelato che la chiave del registro si trova in HKEY_LOCAL_USER\.... invece che in HKEY_LOCAL_MACHINE\...
Non so perché per questa persona la chiave R sia lì e non dove si trova per me e tutti gli altri, ma la mia domanda rimane: posso semplicemente chiedere a JMP di cercare una chiave di registro diversa?