help for whichlist(Roger Newson)

Input list of package file items and output lists of present and absent items

whichlist item_list [ , packagelist(packagename_list)
noisily
]

where item_list is a list of one or more items of form filename[.filetype]
valid for input to which,
and packagename_list is a list of names that might belong to Stata packages
that might contain the item_list items.

Description

whichlist inputs a list of one or more items that might be included in Stata packages
and/or input to the which command,
and (optionally) a list of Stata package names
that might belong to packages including the input items.
It outputs lists of present and absent items
and (optionally) lists of complete and incomplete Stata packages.
It is useful for finding out which of a list of Stata packages the user has installed.

Options for whichlist

packagelist(packagename_list) specifies a list of one or more names,
which might belong to Stata packages
which might contain the input items in the item_list.
If it is at least as long as the item_list,
then the kth item of the package list
is assumed to be the name of a package,
which should contain the kth item of the item_list.
If it is present, but shorter than the item_list,
then it is expanded to the same length as the item_list
by adding multiple copies of the last item of the input package name list.
Therefore, if only one package name is input in packagelist(),
then that package name is assumed to belong to a Stata package
that should contain all items in the item_list.

noisily specifies that whichlist
will output all the log output from the which command
for each item in the input item list,
describing the location and possibly description of the item (if the item is present in a file),
or stating that the item is absent or present as a built-in command (otherwise).

Remarks

whichlist, without a packagelist() option,
outputs a list of items present on the user's system
and a list of items absent on the user's system.
whichlist, with a packagelist() option,
also outputs a list of complete package names,
for which all input items with that package name are present on the user's system,
and a list of incomplete package names,
for which some input items with that package name are absent on the user's system.
The output package names tell the user which packages are completely installed on the user's system,
in the sense that all input items that the user thinks the package should contain
are present on the user's system.

It is the user's responsibility to specify the correct package for each input item.
It is not recommended, but not unknown, for users to download an incomplete subset of the files in a package.

Advanced users and develperso are hereby encouraged
to use and modify the internal code for whichlist
in their own packages,
to check the presence of files and commands on which their packages are dependent.

Examples

List the files belonging to the SSC package parmest if present:

. whichlist parmest parmby parmcip metaparm

List the files belonging to parmest if present and check the presence of all of them:

. whichlist parmest parmby parmcip metaparm, package(parmest)

List the files belonging to the SSC packages parmest and somersd if present,
checking the presence of all files in each package:

. whichlist parmest parmby parmcip metaparm somersd cendif censlope, package(parmest parmest parmest parmest somersd)

List the files belonging to the packages parmest, somersd, and nutztoyou if present,
checking the presence of all files in each package;
and outputting information on each input item,
and then list rhe saved results:

. whichlist parmest parmby parmcip metaparm somersd nutztoyou, package(parmest parmest parmest parmest somersd nutztoyou) noisily

. return list

The packages parmest and somersd are downloadable from SSC.
The package nutztoyou could not be found using findit,
at the time of writing of this help file.

Saved results

whichlist saves the following in r():

Macros

r(present) List of input items present on the user's system

r(absent) List of input items absent on the user's system

r(complete) List of input package names complete on the user's system

r(incomplete) List of input package names incomplete on the user's system

Author

Roger Newson, King's College London, UK.

Email: roger.newson@kcl.ac.uk

Also see

Manual: [R] which, [R] net, [R] ssc

On-line: help for which, net, ssc