goldingn / versions

Query and Install Specific Versions of Packages on CRAN
Other
24 stars 7 forks source link

Improve installed.versions() message #11

Closed csrvermaak closed 8 years ago

csrvermaak commented 8 years ago

Firstly – thank you for a great package: “versions”, it really makes a useful contribution to the R Toolbox. I have a suggestion about the message in the “installed.versions” function.

I had a bit of a fright at first when I ran the function, as it gave me feedback as such:

> installed.versions("dplyr")
Installing package into ‘C:/Users/Rvermaak/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
[1] "0.4.3"

I thought that it had installed the package, even though I just wanted the version. I then realised it’s only the message in the function that is confusing:

message(sprintf(ngettext(length(pkgs), "Installing package into %s\n(as %s is unspecified)", 
                "Installing packages into %s\n(as %s is unspecified)"), 
                sQuote(lib), sQuote("lib")), domain = NA)

It might be more user friendly if the message stated something like “Checking packages installed in %s (as %s is unspecified))”?

message(sprintf(ngettext(length(pkgs), "Checking package installed in %s\n(as %s is unspecified)", 
                "Checking package installed in %s\n(as %s is unspecified)"), 
                sQuote(lib), sQuote("lib")), domain = NA)

Just a suggestion, perhaps you have a reason I’m missing for the syntax.

goldingn commented 8 years ago

Hi @csrvermaak. I only just saw this issue after getting your email and already pushing a patch. I would have accepted your pull request instead if I'd seen it first!

This is fixed in #13