Open cswarth opened 9 years ago
Actually I think p_install
may be only taking a single argument, not a vector.
Passing a vector seems to work but eventually you get this error,
3: package ‘c’ is not available (for R version 3.2.2)
presumably indicating it parsed 'c()' as a package name.
Only way I have gotten p_install
to work is to pass a single package name at a time.
Yes p_install is only for single packages. p_load
is really the workhorse function in the package. It's meant to load the packages (and install them beforehand if necessary) but I typically use p_load
to install packages when needed. p_load
takes multiple inputs.
This does seem to be an issue with our documentation. It probably would be better for us to allow p_install
to take multiple inputs in a fashion similar to p_load
though.
Yes, I think it would definitely be helpful to have p_install
take multiple inputs so that the functions are a bit more consistent.
I'm surprised we haven't made this change yet but one thing I'm noticing is that to make the change we would need to change p_install to take dots as the first parameter. This would require all of the other parameters to be named and to be spelled out in full (no using 'char' as a shortcut for 'character.only'). This could possibly break some workflows.
With that said our vignette is still out of date with how p_install
actually can be used. We could start by updating the vignette. A long term plan if we didn't want to surprise anybody and create errors would be to add a package startup message or message when p_install is getting called to tell people about a change that will be made in the next version? Kind of like deprecating something but in this case it's not really deprecated... just modified.
@trinker Any thoughts?
It would be nice to be able to also have p_install
state when it starts the install, and when it completes, which I think? it's supposed to do? devtools::install_cran
does this, so maybe simply wrapping that could be an option?
The pacman vignette says,
When I try this I get,
This can be solved by passing a vector to p_install,
I don't know whether the bug is in the vignette or in the code.