Using quotes when loading a package in R

Is there any reason to prefer to use quotation marks when downloading a package; eg.

library("MASS") 

by downloading packages without placing the name in quotation marks;

 library(MASS) 

Looking back at some old code, I seem to switch between them without any noticeable consequences. Is there a best practice recommendation?

+5
source share
1 answer

This is an example of a non-standard assessment. I'm not sure if there is a “best practice” as to whether packages should be placed in quotation marks. But

Argument against

 library(MASS) 

is that it’s hard for new users to guess what

 pkg = "MASS" library(pkg) 

will do.

+2
source

Source: https://habr.com/ru/post/1247750/


All Articles