[R] evil attributes

Bill Dunlap w||||@mwdun|@p @end|ng |rom gm@||@com
Mon Apr 12 02:44:47 CEST 2021

Terry wrote
           I confess to being puzzled WHY the R core has decided on this
definition [of vector] ...
I believe that "R core" followed S's definition of "vector".  From the
beginning (at least when I first saw it in 1981) an S vector was the basic
unit of an S object - it had a type and a length and no more.  This has
little to do with the mathematician's or physicist's notion of a vector.
It is more like what Technopedia (
https://www.techopedia.com/definition/22817/vector-programming) says is a
programmer's notion of a vector:

What Does Vector Mean?
A vector, in programming, is a type of array that is one dimensional.
Vectors are a logical element in programming languages that are used for
storing data. Vectors are similar to arrays but their actual implementation
and operation differs.
Techopedia Explains Vector
Vectors are primarily used within the programming context of most
programming languages and serve as data structure containers. Being a data
structure, vectors are used for storing objects and collections of objects
in an organized structure.
The major difference between and array and a vector is that, unlike typical
arrays, the container size of a vector can be easily increased and
decreased to complement different data storage types. Vectors have a
dynamic structure and provide the ability to assign container size up front
and enable allocation of memory space quickly. Vectors can be thought of as
dynamic arrays.


On Sun, Apr 11, 2021 at 8:04 AM Therneau, Terry M., Ph.D. via R-help <
r-help using r-project.org> wrote:

> I wrote: "I confess to being puzzled WHY the R core has decided on this
> definition..."
> After just a little more thought let me answer my own question.
> a. The as.vector() function is designed to strip off everything extraneous
> and leave just
> the core.   (I have a mental image of Jack Webb saying "Just the facts
> ma'am").   I myself
> use it freqently in the test suite for survival, in cases where I'm
> checking the corrent
> numeric result and don't care about any attached names.
>   b. is.vector(x) essentially answers the question "does x look like a
> result of as.vector?"
> Nevertheless I understand Roger's confusion.
> --
> Terry M Therneau, PhD
> Department of Quantitative Health Sciences
> Mayo Clinic
> therneau using mayo.edu
> "TERR-ree THUR-noh"
>         [[alternative HTML version deleted]]
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]

More information about the R-help mailing list