Page 1 of 1

[SOLVED] Cannot load package

PostPosted: Tue Aug 08, 2017 7:57 pm
by radillon
Hi,

I cannot get RGeostats to load. Below is the code I execute to load the package and the error checking code. I've tried deleting this version of the package, and installing a previous version that I was working fine with before, but get the same message regardless of version.

Code: Select all
> install.packages("C:/Users/dillon.361/AppData/Local/Temp/RGeostats_11.0.6.zip", repos = NULL, type = "win.binary")
package ‘RGeostats’ successfully unpacked and MD5 sums checked
> library(RGeostats)
Loading RGeostats - Version:11.0.6
Error : .onAttach failed in attachNamespace() for 'RGeostats', details:
  call: projdef$active
  error: object of type 'closure' is not subsettable
Error: package or namespace load failed for ‘RGeostats’
> getwd()
[1] "C:/Users/dillon.361/Documents"
> R.Version()$platform
[1] "x86_64-w64-mingw32"
> R.Version()$version.string
[1] "R version 3.3.3 (2017-03-06)"
> packageVersion("Rcpp")
[1] ‘0.12.12’
> packageVersion("RGeostats")
[1] ‘11.0.6’
> packageVersion("maps")
[1] ‘3.2.0’
> packageVersion("mapproj")
[1] ‘1.2.5’
> for (trgo_ in ls(all.names=T)) { print(trgo_); print(class(eval(parse(text=trgo_)))); cat("\n") }; rm(trgo_)
[1] ".Random.seed"
[1] "integer"

[1] "Acton"
[1] "data.frame"

[1] "AlumCreek"
[1] "data.frame"

[1] "April21"
[1] "data.frame"

[1] "April26"
[1] "data.frame"

[1] "Aug1"
[1] "data.frame"

[1] "bar"
[1] "function"

[1] "BurrOak"
[1] "data.frame"

[1] "Chaoblength"
[1] "data.frame"

[1] "count1"
[1] "numeric"

[1] "data"
[1] "data.frame"

[1] "Data"
[1] "data.frame"

[1] "data.1"
[1] "data.frame"

[1] "data.frame"
[1] "data.frame"

[1] "fish1"
[1] "character"

[1] "Hoover"
[1] "data.frame"

[1] "June6"
[1] "data.frame"

[1] "June7"
[1] "data.frame"

[1] "Lower.Bound"
[1] "numeric"

[1] "Lower.Bound.Original"
[1] "numeric"

[1] "May24"
[1] "data.frame"

[1] "Model"
[1] "aov" "lm"

[1] "nueston"
[1] "data.frame"

[1] "TSalum"
[1] "data.frame"

[1] "Upper.Bound"
[1] "numeric"

[1] "Upper.Bound.Original"
[1] "numeric"

Re: cannot load package

PostPosted: Tue Aug 22, 2017 12:59 pm
by Fabien Ors
Dear,
I think that the problem comes from your current workspace variables.
Please, could you try to rename the variables "data", "Data" and "data.frame" from your workspace by using different names less generics?
Hope this helps,
Best regards.

Re: cannot load package

PostPosted: Tue Aug 22, 2017 1:01 pm
by Fabien Ors

Re: cannot load package

PostPosted: Wed Sep 06, 2017 12:58 pm
by Fabien Ors
Dear.
A workaround has been found to the problem about the 'closure' error:
Please have a look to the workaround here while waiting for the next RGeostats version which will fix this issue.

Re: cannot load package

PostPosted: Fri Sep 08, 2017 3:24 pm
by radillon
Hi Fabien,

Thanks for the replies. The workaround you suggested worked for getting RGeostats to actually load, however I have the same problem as Jennifer when I try to use the polygon.create function.

Code: Select all
poly.data_Acton_LL <- polygon.create(x = as.data.frame(A4@coords))
Error in if (inter != which(is.na(y))) stop0("Arguments 'x' and 'y' should have the same set of 'NA'") :
  argument is of length zero


I made sure to upgrade to the latest version of RGeostats that you linked to in your reply to Jennifer. Just like her, this code had worked in the past.

Please advise.

Thanks

Re: cannot load package

PostPosted: Fri Sep 29, 2017 1:31 pm
by Fabien Ors
The new RGeostats version 11.1.2 fixes the closure error when using projection:
viewtopic.php?f=2&t=390
The polygon.create function has been fixed in RGeostats 11.1.1
I put 'SOLVED' at this topic but, please, let us know (in a new topic), if you still experience some troubles.