Formula Data and Explicit Native Inputs
np-data-interfaces.RdThe role of data depends on the selected interface. It is never a
request to silently ignore a supplied training sample.
Details
Formula calls use data for model-frame construction. Supported refits
through a bandwidth object retaining a formula also accept replacement
data; their established omitted-data and data = NULL behavior
is unchanged.
Native interfaces use explicitly supplied vectors, matrices or data frames.
Where data is not a native input, even explicitly supplying
data = NULL is an error. Omit it, supply inputs such as
xdat = d["x"] and ydat = d$y, or evaluate the native call inside
with(d, ...). Native inputs use ordinary R evaluation, not a data mask.
Directly supplied, unbound native observation names receive this interface
guidance at their existing argument-resolution boundary. No data-mask lookup
is attempted. Existing argument evaluation and method dispatch are preserved. An error in
a supplied expression may therefore occur before the native-data diagnostic;
MPI methods retain their normal error context.
This includes the native IV interfaces: use with(d, npregiv(y, z, w))
or the supported formula interface.
Some functions genuinely consume a native argument called data.
In particular, npcopula(bws, data = observations), b.star,
npsdeptest and npsymtest retain their documented data inputs.
This policy does not change newdata, native evaluation arguments, or
which input takes precedence during prediction.
Plotting does not generally provide a replacement-data interface. A supplied
data argument is rejected when the selected plot route does not consume
it, including explicit NULL. Refit with the intended data and plot the
result, or use supported explicit plotting inputs. The existing partially
linear formula-bandwidth plot route retains its replacement-data support when
its explicit training inputs are omitted.
The diagnostic for unsupported native data is:
`data=` is supported only with the formula interface. For native calls, supply vectors, matrices or data frames directly, or use `with(data, ...)`.