Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any special functionality in R package "exec" or "tools" directories?

Tags:

r

I'm trying to develop an R package that will include some previously compiled executable programs and their supporting libraries. (I know this is bad form, but it is for internal use).

My question: Does the special exec and tools directories have any special functionality within R?

The documentation seems to be sparse. Here is what I've figured out so far:

From here

  • files contained in exec are marked as executable on install
  • subdirectories in exec are ignored
  • exec is rarely used (my survey of CRAN says tools is just as rarely used)
  • tools is around for configuration purposes?

Do these directories offer any that I couldn't get from creating an inst/programs directory?

like image 744
lawinslow Avatar asked Sep 29 '14 16:09

lawinslow


People also ask

What is Rbuildignore?

Rbuildignore is a Perl-compatible regular expression that is matched, without regard to case, against the path to each file in the source package 1. If the regular expression matches, that file or directory is excluded.

What is the inst folder in R package?

When making an R package the inst folder is for files/folders that should be copied unmodified into the installed R package folder.

How do you get documentation of an installed and loaded R package?

List functions in R package. Once installed, you can get a list of all the functions in the package. If the package is on CRAN, you will find documentation in PDF format of all functions inside a page like https://cran.r-project.org/web/packages/package_name .


1 Answers

[R-exts] has this to say:

Subdirectory exec could contain additional executable scripts the package needs, typically scripts for interpreters such as the shell, Perl, or Tcl. This mechanism is currently used only by a very few packages. NB: only files (and not directories) under exec are installed (and those with names starting with a dot are ignored), and they are all marked as executable (mode 755, moderated by ‘umask’) on POSIX platforms. Note too that this is not suitable for executable programs since some platforms (including Windows) support multiple architectures using the same installed package directory.

It's quite possible the last note won't apply to you if it's only for internal use.

Nevertheless, I'd suggest avoiding abusing any existing convention that might not apply precisely to your situation, and instead use inst/tools or inst/bin.

like image 80
hadley Avatar answered Oct 10 '22 05:10

hadley