I work on a group project. For my analyses, I need a few packages. So in order to let my script work on everyones computer I tell R at the beginning to check for the name of the required package among all installed packages, and, if the name is not there, install it. My code is:
{
ifelse("ggplot2" %in% rownames(installed.packages()),"" ,install.packages("ggplot2"))
ifelse("agricolae" %in% rownames(installed.packages()),"" ,install.packages("agricolae"))
ifelse("lattice" %in% rownames(installed.packages()),"" ,install.packages("lattice"))
ifelse("DescTools" %in% rownames(installed.packages()),"" ,install.packages("DescTools"))
ifelse("FSA" %in% rownames(installed.packages()),"" ,install.packages("FSA")) }
But it seems to work not quite good. Like, R installes the first, but not the second. Is it just because ggplot is too huge and R forgetsthe rest or do I have another mistake?
Thank you all ahead!