0

Try to run one of the scripts from R in QGIS and show me the next message.

  • Versión de QGIS: 3.28.3-Firenze
  • Revisión del código de QGIS: c12bcb2f76c
  • Versión de Qt: 5.15.3
  • Python version: 3.9.5
  • Versión de GDAL: 3.6.2
  • Versión de GEOS: 3.11.1-CAPI-1.17.1
  • Versión de PROJ: Rel. 9.1.1, December 1st, 2022
  • PDAL version: 2.4.3 (git-version: f8d673)
  • R versión: QGIS R Provider version 3.0.0, R version 4.2.2 (2022-10-31 ucrt) -- "Innocent and Trusting"

El algoritmo comenzó en: 2023-02-15T15:34:28 Algoritmo '1. Histogram 1' comenzando…

Parámetros de entrada:

{ 'Layer' : 'C:/Users/pedro/Desktop/R_and_Qgis/QGIS_DATA_MEUSE/CAPAS/groundwater_SHP.shp', 'Parameter' : 'gw', 'RPLOTS' : 'TEMPORARY_OUTPUT' }

R execution commands

options("repos"="https://cran.at.r-project.org/ ")
.libPaths("C:/Users/pedro/AppData/Roaming/QGIS/QGIS3/profiles/default/processing/rlibs")
tryCatch(find.package("sf"), error = function(e) install.packages("sf", dependencies=TRUE))
library("sf")
tryCatch(find.package("raster"), error = function(e) install.packages("raster", dependencies=TRUE))
library("raster")
tryCatch(find.package("ggplot2"), error = function(e) install.packages("ggplot2", dependencies=TRUE))
library("ggplot2")
Layer <- st_read("C:/Users/pedro/Desktop/R_and_Qgis/QGIS_DATA_MEUSE/CAPAS/groundwater_SHP.shp", quiet = TRUE, stringsAsFactors = FALSE)
Parameter <- "gw"
RPLOTS <- "C:/Users/pedro/AppData/Local/Temp/processing_NrkcUZ/c1d698df3c114f0ba8683f055e935159/RPLOTS.html"
png("C:/Users/pedro/AppData/Local/Temp/processing_NrkcUZ/54d674612e0544ec9c189b752431c340/RPLOTS.png")

library(ggplot2)

ggplot(NULL, aes(Layer[[Parameter]])) + geom_histogram()
dev.off()

R execution console output

Installing package into 'C:/Users/pedro/AppData/Roaming/QGIS/QGIS3/profiles/default/processing/rlibs' (as 'lib' is unspecified) Warning: unable to access index for repository https://cran.at.r-project.org/ /src/contrib: no fue posible abrir la URL 'https://cran.at.r-project.org/ /src/contrib/PACKAGES' Warning: unable to access index for repository https://cran.at.r-project.org/ /bin/windows/contrib/4.2: no fue posible abrir la URL 'https://cran.at.r-project.org/ /bin/windows/contrib/4.2/PACKAGES' Warning message: package 'sf' is not available for this version of R

A version of this package for your version of R might be available elsewhere, see the ideas at https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages Error in library("sf") : there is no package called 'sf' Ejecución interrumpida Execution completed in 0.37 segundos Resultados: {'RPLOTS': 'C:/Users/pedro/AppData/Local/Temp/processing_NrkcUZ/1aa2aa77d0534b43839fd32793970961/RPLOTS.html'}

Cargando las capas resultantes Algoritmo '1. Histogram 1' finalizado La salida HTML ha sido generada por este algoritmo. Abra el diálogo de resultados para comprobarla.

1

1 Answer 1

1

I have already found the problem. The problem was a simple extra space at the end of the URL of the package repository. The URL was "https://cran.at.r-project.org/ ". I just had to delete it and it worked. The correct one is without the space: "https://cran.at.r-project.org/"

Note that when I first installed the complement R process, this was the default setting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.