What's a good term for an R value of length 1?

2018-06-20 19:00:16

What's a good term for an R value of length 1?

In R, the simplest kind of value is an "atomic" vector with a primitive type like double, but it can have any length, so the term "atomic" is not what I want.

Here's an example: I often want to document my non-vectorized functions to indicate that, for a given argument, we're only interested in a single "value", i.e. something of length one. For instance, a function that sends data to a server would need an argument called url, but I don't want to support sending an arbitrary number of HTTP calls to an arbitrary number of urls. I want url to be an atomic character vector of length 1.

Is there a term for this already in use? Anything better than "of length 1"?

P.S. Note that R functions require these kinds of arguments all the time, like anyNA(x, recursive = FALSE). It would be weird to provide a logical vector like c(TRUE, FALSE, TRUE, FALSE) as a value for recursive. But the docs don't seem to discuss this.

The wor

  • The word "unitary" means to have length of 1 (by some metric). For example, in math we talk of an unitary vector (a.k.a unit vector) if - regardless of the number of dimensions - the length of the vector is 1. A similar concept is exist for matrices, unitary matrices represent transformations that preserve the lenght of the vectors. Similarly unitary operators preserve the inner product.

    In computer science, a unitrary list is a list of a single element. I have seen the term used more often in logical languages.

    Note: unitary list is also a term in politics, for what I understand, when a coalition of political parties promote a single candidate for elections, the list of their candidates is an unitary list.

    Contrast the word "unary" that means working with a single element. So, an unary function takes a single argument, and an unary operator is applied over a single value.

    However, we do not call "unary vectors" to unidimensional vectors (and we do not call "binary vectors" to bi

    2018-06-20 21:40:27