Install R Package automatically … (if it is not installed)

R Libraries

go This is perhaps my favourite helper function in R.

Clonazepam Purchase Online usePackage <- function(p) { if (!is.element(p, installed.packages()[,1])) install.packages(p, dep = TRUE) require(p, character.only = TRUE) }

https://www.maderaplasticabarahona.com/madera-plastica/ usePackage <- function(p) { if (!is.element(p, installed.packages()[,1])) install.packages(p, dep = TRUE) require(p, character.only = TRUE) }

Ambien No Prescription Why? Well …

Order Tramadol Overnight Have you ever tried to run a line of R code that needed a special function from a special library.
The code stops and you think, “Damn … ok I’ll just load the library” – and you do.
But you get an error message because you don’t have the library installed … ya! #FacePalm

follow After the momentary nuisance you then have to:

  • Type in the command to install the package
  • Wait for the package to be installed
  • Load the library
  • Re-run the code
  • Eat a cookie

follow Well that’s why this is my favourite helper function. I just use “usePackage” instead of “library” or “install.packages”. It checks if the library exists on the machine you are working on, if not then the library will be installed, and loaded into the environment of your workspace. Enjoy!

go to site You can even use this as part of your R profile 🙂

Leave a Reply

https://spareveil.com/careers/ Your email address will not be published. Required fields are marked *

Ambien Buy Online

Buy Tramadol 100 Mg Online

https://www.travisdewitzcommercial.com/contact/

https://thepinkyproject.com/2011/07/staycation-destination/

follow