0

I am with MRO 3.5.3 on Ubintu 18.04, when using utils::choose.dir, it says "no such function". But it is there at R document site. After checking, the utils library is 3.5.3, and the latest is 3.6.1.

`> installPackages("utils")

Installing package into ‘/home/kkk/R/x86_64-pc- linux-gnu-library/3.5’ (as ‘lib’ is unspecified)

Warning messages:

1: package ‘utils’ is not available (for R version 3.5.3)
2: package ‘utils’ is a base package, and should not be updated

How can I update the utils and get the function I need? Thanks

Grec001
  • 1,111
  • 6
  • 20
  • I think you need to update the R version and `utils` library will be auto-updated. – Ronak Shah Nov 05 '19 at 04:31
  • I thought Microsoft R open (MRO) 3.5.3 is already the latest. Thanks. – Grec001 Nov 05 '19 at 04:34
  • 1
    `utils`, along with many other "base packages", are only updated with the entire R installation. They are not available as individual packages. While there may be other reasons, the biggest rationale I can think of for this is that so much of R's internal workings rely on tight coupling between these packages, and changing much of the ABI/API could endanger that. Weak, perhaps, but ... still, you can't update these packages, just update R. – r2evans Nov 05 '19 at 04:57
  • 2
    As for why you cannot find that function: [`?choose.dir`](https://stat.ethz.ch/R-manual/R-devel/library/utils/html/choose.dir.html) states that *"This is only available on Windows."*. – r2evans Nov 05 '19 at 04:58
  • 1
    How stupid I am! Thanks! – Grec001 Nov 05 '19 at 05:04

1 Answers1

0

it turns out the {rstudioapi} is the solution for specific function.

OS-independent way to select directory interactively in R

Grec001
  • 1,111
  • 6
  • 20
  • 1
    Side note, though, is that this does not work unless actually using RStudio. For most this won't be a problem, but any other IDE is still out of luck. – r2evans Nov 05 '19 at 15:41