I know that for a list, partial matching is done when indexing using the basic operators
ll <- list(yy=1)
h <- function(xx=2)xx
pmatch("me", c("mean", "median", "mode")) # error multiple partial matches
> pmatch("mo", c("mean", "median", "mode")) # mo match mode match here
Partial matching exists to save you typing long argument names. The danger with it is that functions may gain additional arguments later on which conflict with your partial match. This means that it is only suitable for interactive use – if you are writing code that will stick around for a long time (to go in a package, for example) then you should always write the full argument name. The other problem is that by abbreviating an argument name, you can make your code less readable.
Two common good uses are:
len instead of
length.out with the
all instead of
all.names with the
seq.int(0, 1, len = 11) seq.int(0, 1, length.out = 11) ls(all = TRUE) ls(all.names = TRUE)
In both of these cases, the code is just about as easy to read with the shortened argument names, and the functions are old and stable enough that another argument with a conflicting name is unlikely to be added.