Why am I getting a KeyError message? - julia

Every time I call Pkg.Update() I get the following message:
KeyError: key "RDataSets" not found
I am aware that the correct name of the package is RDatasets and not RDataSets. When I first tried to install this package I must have made a mistake and entered a capital "S." Actually the package initially did not install and I had to painfully call Pkg.clone() for several packages it depended on.
Is this an indication of a serious problem? Everything seems to be working fine, but I am just starting (again) with Julia, so I am not sure. Also, can this problem be fixed?

Related

Circularity detected when running (vega:load-vega-examples)

When I load the vega-lite data sets using
(vega:load-vega-examples)
I get the following error:
Could not REQUIRE CL-DATE-TIME-PARSER: circularity detected. Please check your configuration
However, the examples appear to have loaded.
Also, before I installed cl-date-time-parser in quicklisp, I was getting an error message similar to:
Do not know how to REQUIRE CL-DATE-TIME-PARSER
Does anyone know how to get rid of these errors?
Many thanks!
The IMDB example requires cl-date-time-parser. I suspect that problem is that (require ...) only works when the library is in a location known to ASDF. In a new installation, this may not be the case. Now reported as issue #19.
Try loading the library with quicklisp and then rerunning load-vega-examples.

devtools::check generates an error (install options '--no-html --no-multiarch) at seemingly randomly times

I am creating my own package and use devtools to document and check the package. About 50% of the time that I run devtools::check() it ends with this error:
❯ checking whether package 'snafun' can be installed ... ERROR See below...
── Install failure ─────────────────────────────────────────────────────────────────────────────────────────────────
install options '--no-html --no-multiarch
However, this only happens about half the time. Sometimes it doesn't and sometimes it does. I can run devtools::check several times in a row (without making any change to the code or the session in between) and get this error on half of the runs, and on the other half not. And sometimes it seems to help if I restart the session in between an other times it makes no difference.
I have tried playing with the arguments of devtools::check, but that doesn;t seem to affect the error (which could be related to this being an "Install failure" and devtools::check doesn't have install arguments).
I am puzzled. I have the following questions:
what does this error even mean? Is it problematic?
what can make it occur and disappear seemingly randomly?
what might be a direction to solve this?
ps the package is quite large, so I can't really turn this into a reprex
I got exactly the same problem and I solved it installing the rcmdcheck package.
install.packages("rcmdcheck")
library(rcmdcheck)
rcmdcheck('MyPath/MyPackage')

Weird issue while testing R package: package `[package name]` found more than once, using the first from [file path]

I'm working on a somewhat complex package (that I unfortunately can't share) that involves a Shiny app, and it an issue has surfaced where I'm getting these warnings when testing:
package [package name] found more than once, using the first from [file path]
In library(testthat) : package ‘testthat’ already present in search()
The first one occurs because I'm using system.file to pull a file in inst that I use for testing.
I've tried to do some debugging with .libPaths and by forcing system.file to go to the .libPaths default with the lib.loc argument, but that doesn't do anything.
I've tried uninstalling the package, which works because then there are not multiple results for find.package.
It seems like testthat adds the current directory to the library paths while it's running, and this creates the issue with system.file and consequently, find.package.
I'm really confused as to what's causing this. I'm combing through the changes I've made and I can't seem to find anything. Any ideas are helpful. I've tried googling this error messages and all that comes up is the source.
The issue here was with changing the option setting for verbose. That caused more output to result from the code, which broke a lot of tests. I hope this helps someone in the future.

devtool::test() gives warning, R CMD check ok

devtools::test() gives me a warning each time one of my internal function is ran. But when I run the incriminated codes in the console there is no warning. In addition R CMD check or devtools::check() don't complain about these lines of code (no error, no warning, no note).
So it means that devtools::test() run the tests using different settings compared to the regular R environment and compared to R CMD check.
I investigated and I didn't find any hint even if I found several topics with more a less comparable questions. This is not really a problem because the outputs are good and the problem does not occur on CRAN or when running the code. But I would like to remove these warning from devtools::test().
Please note that my question does not concern how to fix the warnings but how to get a chance to reproduce the problem in attempt to solve it.

Error in fetch(key) : lazy-load database

I don't know what is going on, everything was working great but suddenly I started to have this error message on the documentation:
Error in fetch(key) : lazy-load database '......descopl.rdb' is
corrupt
I removed almost all my code and build again then publish to Github, but when I use the other laptop to download the package, the package is being downloaded and loaded but I can't call any of the functions, and the documentation states that error.
I don't know what caused the problem, I am using roxygen to generate the documentation.
https://github.com/WilliamKinaan/descopl
It seems that the error arises when the package cannot be decompressed by R (as #rawr established, it is corrupt). This solutions have worked for me:
1) Check for possible errors in the creation of the .Rdb files
2) Try restarting your R session (e.g. .rs.restartR() if in RStudio)
3) The package might have been installed in your computer (even though it does not work). Remove it using ?remove.packages()
I have had this problem with roxygen2 as well. Couldn't see any problem with any of my functions. In the end deleting the .rdb file and then getting roxygen2 to rebuild it seemed to solve the problem.
I think the explanation for what is causing this is here.
It's related to devtools.
Per #Zfunk
cd ~/Rlibs/descopl/help
rm *.rdb
Restart R. Look at the help for the package again. Fixed!
I received this error after re-installing a library whilst another R session was running.
Simply restarting the existing R session(s) solved for me (i.e. running .rs.restartR() to restart the sessions)
If you are using R-studio:
1) ctrl+shift+f10 to restart r session
2) tools -> Check for package updates -> update all packages
3) library(ggmap)
Problem is solved.
Basically all answers require restarting R to resolve the issue, but I found myself in an environment where I really didn't want to restart R.
I am posting here a somewhat hack-ish solution suggested by Jim Hester in a bug report about the lazy-load corruption issue.
The gist of it is that the package may have some vestigial S3 methods listed in session's .__S3MethodsTable__. environment. I don't have a very systematic way of identifying which S3 methods in that environment come from where, but I think a good place to start is the print methods, and looking for S3method registrations in the package's NAMESPACE.
You can then remove those S3 methods from the .__S3MethodsTable__. environment and try again, e.g.
rm(list="print.object", envir = get(".__S3MethodsTable__.", envir = baseenv()))
You may also need to unload some DLLs if some new messages come up like
no such symbol glue_ in package /usr/local/lib/R/site-library/glue/libs/glue.so
You can check getLoadedDLLs() to see which such files are loaded in your session. In the case of glue here, the following resolved the issue:
library.dynam.unload('glue', '/usr/local/lib/R/site-library/glue')
I got this error on RStudio on mac OS - updating all the packages and restarting r session did the trick.

Resources