Skip to content

Argument lengths #1

@andrew-primer-e

Description

@andrew-primer-e

The probability distribution functions in base R (such as stats::dnbinom) accept arguments with different lengths and produce an output whose length is equal to the length of the largest argument.
They then recycle their shorter arguments when performing the calculations.
This can be convenient, but it also limits what mistakes we can detect.

I think we should be much more strict about the length of function arguments we accept.
Only allowing scalars or vectors which are the same length as each other would be very flexible, but also rule out quite a few common mistakes.

In any case, we need to check that all functions have consistent requirements and that they are document.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions