How to unload a package without restarting R

Try this (see ?detach for more details): detach(“package:vegan”, unload=TRUE) It is possible to have multiple versions of a package loaded at once (for example, if you have a development version and a stable version in different libraries). To guarantee that all copies are detached, use this function. detach_package <- function(pkg, character.only = FALSE) { if(!character.only) … Read more

What is the difference between require() and library()?

There’s not much of one in everyday work. However, according to the documentation for both functions (accessed by putting a ? before the function name and hitting enter), require is used inside functions, as it outputs a warning and continues if the package is not found, whereas library will throw an error.

What is a Python egg?

Note: Egg packaging has been superseded by Wheel packaging. Same concept as a .jar file in Java, it is a .zip file with some metadata files renamed .egg, for distributing code as bundles. Specifically: The Internal Structure of Python Eggs A “Python egg” is a logical structure embodying the release of a specific version of … Read more

How should I deal with “package ‘xxx’ is not available (for R version x.y.z)” warning?

1. You can’t spell The first thing to test is have you spelled the name of the package correctly? Package names are case sensitive in R. 2. You didn’t look in the right repository Next, you should check to see if the package is available. Type setRepositories() See also ?setRepositories. To see which repositories R … Read more

How to fix “Attempted relative import in non-package” even with __init__.py

To elaborate on Ignacio Vazquez-Abrams’s answer: The Python import mechanism works relative to the __name__ of the current file. When you execute a file directly, it doesn’t have its usual name, but has “__main__” as its name instead. So relative imports don’t work. You can, as Igancio suggested, execute it using the -m option. If … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)