R-ArcGIS / r-bridge-install

Install the R ArcGIS Tools
Apache License 2.0
188 stars 59 forks source link

Install R binding in ArcGIS Pro under R version 4.3.1 error? #122

Open rakatz42 opened 7 months ago

rakatz42 commented 7 months ago

I have version 4.3.2 of R installed and used install.packages("arcgisbinding", repos="https://r.esri.com", type="win.binary") library(arcgisbinding) to download this package. Using arc.check_product(), I see that I'm "Signed in" with version 8.2 via our organizational portal. I can return an object using d <- arc.open("https://services.arcgis.com/QVENGdaPbd4LUkLV/arcgis/rest/services/NWRS_Regional_Invasive_Survey/FeatureServer"), but when I try to run d <- arc.select(arc.open("https://services.arcgis.com/QVENGdaPbd4LUkLV/arcgis/rest/services/NWRS_Regional_Invasive_Survey/FeatureServer")) it returns "Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘arc.select’ for signature ‘"arc.workspace_impl"’. I went back and downloaded the r-bridge-install-master from here and then clicked on "Install R bindings" using the R Integration.pyt / Install R bindings in ArcGIS Pro 13.1.3.41833 and am getting this error message. Seems like it's version control thing and it's looking for version 4.3.1 of R, but I have version 4.3.2? How can I update the version of R it is installing to? Thanks!

"Install R bindings Parameters

Overwrite Existing Installation? false Selected R Version (Set As Default) 4.3.1 Messages

Start Time: Thursday, February 22, 2024 6:24:53 PM Rscript.exe C:\Users\rkatz\AppData\Local\Temp\1\ArcGISProTemp23012\tmpv03ulztg\install.R Warning in install.packages("arcgisbinding", repos = "https://r.esri.com", : 'lib = "C:/Program Files/R/R-4.3.1/library"' is not writable Error in install.packages("arcgisbinding", repos = "https://r.esri.com", : unable to install packages Execution halted R command returned non-zero exit status. Failed to install bridge with install.packages, try manualy running the command {cmd} from an R session or RStudio. Failed to execute (InstallBindings). Failed at Thursday, February 22, 2024 6:24:54 PM (Elapsed Time: 0.74 seconds)"

I then tried to change "4.3.1" to "4.3.2", which I do have installed and got the same error....

"Install R bindings Parameters

Overwrite Existing Installation? false Selected R Version (Set As Default) 4.3.2 Messages

Start Time: Thursday, February 22, 2024 6:24:17 PM Updating default R to 4.3.2 Traceback (most recent call last): File "", line 232, in execute File "", line 244, in set_default_r KeyError: '4.3.2'

Failed to execute (InstallBindings). Failed at Thursday, February 22, 2024 6:24:17 PM (Elapsed Time: 0.01 seconds)"

JosiahParry commented 7 months ago

Hey @rakatz42, thanks for the heads up.

It looks like you're trying to select from a feature server. But a server is a collection of one or more feature layers. So the act of arc.select() on a server won't work. For example if you open https://services.arcgis.com/QVENGdaPbd4LUkLV/ArcGIS/rest/services/2016_Release_Locations_WFL1/FeatureServer in the browser there are two listed layers: 1) Site_RKM and 2) 2016_Release_Locations. Click one of those to get their url (typically ending in /0 or /1).

For example

furl <- "https://services.arcgis.com/QVENGdaPbd4LUkLV/arcgis/rest/services/NWRS_Regional_Invasive_Survey/FeatureServer/0"

arc.select(arc.open(furl))