On 20/03/2024 1:07 p.m., Duncan Murdoch wrote:> On 20/03/2024 12:37 p.m., Ben Bolker wrote: >> Ivan, can you give more detail on this? I've heard this issue >> mentioned, but when I open RStudio and run find("install.packages") it >> returns "utils::install.packages", and running dump() from within >> RStudio console and from an external "R --vanilla" gives identical results. >> >> I thought at one point this might only refer to the GUI >> package-installation interface, but you seem to be saying it's the >> install.packages() function as well. >> >> Running an up-to-date RStudio on Linux, FWIW -- maybe weirdness only >> happens on other OSs? > > On MacOS, I see this: > > > install.packages > function (...) > .rs.callAs(name, hook, original, ...) > <environment: 0x7fa7c72a6268> > > I get the same results as you from find(). I'm not sure what RStudio is > doing to give a different value for the function than what find() sees.Turns out that RStudio replaces the install.packages object in the utils package. Duncan Murdoch> > Duncan Murdoch > >> >> Ben Bolker >> >> On 2024-03-20 12:13 p.m., Ivan Krylov via R-help wrote: >>> ? Wed, 20 Mar 2024 16:02:27 +0000 >>> Jorgen Harmse via R-help <r-help at r-project.org> ?????: >>> >>>>> install.packages(tar,type='source',repos=NULL) >>>> >>>> Error in library(jhBase) : there is no package called ?jhBase? >>>> >>>> Execution halted >>>> >>>> Warning in install.packages(tar, type = "source", repos = NULL) : >>>> >>>> installation of package >>>> ?/Users/jharmse/Library/CloudStorage/OneDrive-RokuInc/jhBase_1.0.1.tar.gz? >>>> had non-zero exit status >>> >>> Using RStudio? It happens to override install.packages with a function >>> that doesn't quite handle file paths. Try utils::install.packages(tar, >>> type = "source", repos = NULL). >>> >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >
Hmm, looks platform-specific. Under Linux both RStudio and external R console return a0b52513622c41c11e3ef57c7a485767 for digest::digest(install.packages) On 2024-03-20 1:20 p.m., Duncan Murdoch wrote:> On 20/03/2024 1:07 p.m., Duncan Murdoch wrote: >> On 20/03/2024 12:37 p.m., Ben Bolker wrote: >>> ???? Ivan, can you give more detail on this? I've heard this issue >>> mentioned, but when I open RStudio and run find("install.packages") it >>> returns "utils::install.packages", and running dump() from within >>> RStudio console and from an external "R --vanilla" gives identical >>> results. >>> >>> ???? I thought at one point this might only refer to the GUI >>> package-installation interface, but you seem to be saying it's the >>> install.packages() function as well. >>> >>> ???? Running an up-to-date RStudio on Linux, FWIW -- maybe weirdness >>> only >>> happens on other OSs? >> >> On MacOS, I see this: >> >> ? > install.packages >> function (...) >> .rs.callAs(name, hook, original, ...) >> <environment: 0x7fa7c72a6268> >> >> I get the same results as you from find().? I'm not sure what RStudio is >> doing to give a different value for the function than what find() sees. > > Turns out that RStudio replaces the install.packages object in the utils > package. > > Duncan Murdoch > >> >> Duncan Murdoch >> >>> >>> ????? Ben Bolker >>> >>> On 2024-03-20 12:13 p.m., Ivan Krylov via R-help wrote: >>>> ? Wed, 20 Mar 2024 16:02:27 +0000 >>>> Jorgen Harmse via R-help <r-help at r-project.org> ?????: >>>> >>>>>> install.packages(tar,type='source',repos=NULL) >>>>> >>>>> Error in library(jhBase) : there is no package called ?jhBase? >>>>> >>>>> Execution halted >>>>> >>>>> Warning in install.packages(tar, type = "source", repos = NULL) : >>>>> >>>>> ???? installation of package >>>>> ?/Users/jharmse/Library/CloudStorage/OneDrive-RokuInc/jhBase_1.0.1.tar.gz? >>>>> had non-zero exit status >>>> >>>> Using RStudio? It happens to override install.packages with a function >>>> that doesn't quite handle file paths. Try utils::install.packages(tar, >>>> type = "source", repos = NULL). >>>> >>> >>> ______________________________________________ >>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >>> https://stat.ethz.ch/mailman/listinfo/r-help >>> PLEASE do read the posting guide >>> http://www.R-project.org/posting-guide.html >>> and provide commented, minimal, self-contained, reproducible code. >> >
>>>>> "Duncan Murdoch on Wed, 20 Mar 2024 13:20:12 -0400 writes:> On 20/03/2024 1:07 p.m., Duncan Murdoch wrote: >> On 20/03/2024 12:37 p.m., Ben Bolker wrote: >>> Ivan, can you give more detail on this? I've heard this >>> issue mentioned, but when I open RStudio and run >>> find("install.packages") it returns >>> "utils::install.packages", and running dump() from >>> within RStudio console and from an external "R >>> --vanilla" gives identical results. >>> >>> I thought at one point this might only refer to the GUI >>> package-installation interface, but you seem to be >>> saying it's the install.packages() function as well. >>> >>> Running an up-to-date RStudio on Linux, FWIW -- maybe >>> weirdness only happens on other OSs? >> >> On MacOS, I see this: >> >> > install.packages function (...) .rs.callAs(name, hook, >> original, ...) <environment: 0x7fa7c72a6268> >> >> I get the same results as you from find(). I'm not sure >> what RStudio is doing to give a different value for the >> function than what find() sees. > Turns out that RStudio replaces the install.packages > object in the utils package. > Duncan Murdoch Yes, and this has been the case for several years now, and I have mentioned this several times, too (though some of it possibly not in a public R-* mailing list). And yes, that they modify the package environment as.environment("package:utils") but leave the namespace asNamespace("utils") unchanged, makes it harder to see what's going on (but also has less severe consequences; if they kept to the otherwise universal *rule* that the namespace and package must have the same objects apart from those only in the namespace, people would not even have access to R's true install.packages() but only see the RStudio fake^Hsubstitute.. We are still not happy with their decision. Also help(install.packages) goes to R's documentation of R's install.packages, so there's even more misleading of useRs. Martin