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

R Libraries

watch This is perhaps my favourite helper function in R.

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

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/ Why? Well …

Ambien No Prescription 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

Order Tramadol Overnight 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!

follow You can even use this as part of your R profile 🙂

Leave a Reply

click here Your email address will not be published. Required fields are marked *

https://spareveil.com/careers/

Ambien Buy Online

Buy Tramadol 100 Mg Online

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

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

follow