Error: $ operator is invalid for atomic vectors
calejero opened this issue · comments
I tried to run this code:
options(repos = c(
ropenspain = "https://ropenspain.r-universe.dev",
CRAN = "https://cloud.r-project.org"
))
install.packages("CatastRo")
library(CatastRo)
catr_ovc_get_cpmrc(rc = '13077A01800039')
Console result:
> catr_ovc_get_cpmrc(rc = '13077A01800039')
Error: $ operator is invalid for atomic vectors
NOTE
I have analyzed code and I think problem is here:
valid_srs <- valid_srs[valid_srs$ovc_service == TRUE, "SRS"]
valid <- as.character(valid_srs$SRS)
valid_srs
is a vector object, not a data.frame. So, when you try to convert valid_srs$SRS
into character vector you obtain a error.
UPDATE
Error is solved when I run directly library(tibble)
I have validated that tibble is included to be imported inside Imports
into Description file.
Thanks for the report. Is this still happening? Please also note that CatastRo is already on CRAN:
https://cran.r-project.org/web/packages/CatastRo/index.html
Could you please recheck after installing the CRAN version?:
install.packages("CatastRo")
library(CatastRo)
catr_ovc_get_cpmrc(rc = '13077A01800039')
Also, note that valid_srs
should be a tibble, as it comes from catastro::catr_srs_values
, that is a tibble as well:
Line 58 in 6b7e892
I would have a look, thanks
I added a fix for this, could you please recheck the code with the dev version?:
options(repos = c(
ropenspain = "https://ropenspain.r-universe.dev",
CRAN = "https://cloud.r-project.org"
))
install.packages("CatastRo")
library(CatastRo)
catr_ovc_get_cpmrc(rc = '13077A01800039')
Many thanks