Re: [Rd] Testing for vectors

2018-07-08 Thread Hadley Wickham
On Sat, Jul 7, 2018 at 11:19 PM, Gabe Becker wrote: > Hadley, > > > On Sat, Jul 7, 2018 at 1:32 PM, Hadley Wickham wrote: >> >> On Sat, Jul 7, 2018 at 1:50 PM, Gabe Becker wrote: >> > Hadley, >> > >> >> >> >> I was thinking primarily of completing the set of is.matrix() and >> >> is.array(), or

Re: [Rd] Testing for vectors

2018-07-08 Thread Hadley Wickham
On Sat, Jul 7, 2018 at 3:48 PM, Ott Toomet wrote: > Thanks, Hadley for bringing this up:-) > > I am teaching R and I can suggest 5 different definitions of 'vector': > > a) vector as a collection of homogeneous objects, indexed by [ ] (more > precisely atomic vector). Sometimes you hear that in R

Re: [Rd] Testing for vectors

2018-07-07 Thread Ott Toomet
Gabe, I agree that If by standard you mean commonly used/understood, though, I doubt > most R users would understand a list to be a vector. I think most people > think of atomic vectors exclusively when they hear "vector" unless they've > very specifically been trained not to do so. However, a c

Re: [Rd] Testing for vectors

2018-07-07 Thread Gabe Becker
Hadley, On Sat, Jul 7, 2018 at 1:32 PM, Hadley Wickham wrote: > On Sat, Jul 7, 2018 at 1:50 PM, Gabe Becker wrote: > > Hadley, > > > >> > >> I was thinking primarily of completing the set of is.matrix() and > >> is.array(), or generally, how do you say: is `x` a 1d dimensional > >> thing? > >

Re: [Rd] Testing for vectors

2018-07-07 Thread Rui Barradas
Hello, Inline. Às 21:32 de 07-07-2018, Hadley Wickham escreveu: On Sat, Jul 7, 2018 at 1:50 PM, Gabe Becker wrote: Hadley, I was thinking primarily of completing the set of is.matrix() and is.array(), or generally, how do you say: is `x` a 1d dimensional thing? Can you clarify what you

Re: [Rd] Testing for vectors

2018-07-07 Thread Ott Toomet
Thanks, Hadley for bringing this up:-) I am teaching R and I can suggest 5 different definitions of 'vector': a) vector as a collection of homogeneous objects, indexed by [ ] (more precisely atomic vector). Sometimes you hear that in R, "everything is a vector", but this is only true for atomic

Re: [Rd] Testing for vectors

2018-07-07 Thread Hadley Wickham
On Sat, Jul 7, 2018 at 1:50 PM, Gabe Becker wrote: > Hadley, > >> >> I was thinking primarily of completing the set of is.matrix() and >> is.array(), or generally, how do you say: is `x` a 1d dimensional >> thing? > > > Can you clarify what you mean by dimensionality sense and specifically 1d > he

Re: [Rd] Testing for vectors

2018-07-07 Thread Gabe Becker
Hadley, > I was thinking primarily of completing the set of is.matrix() and > is.array(), or generally, how do you say: is `x` a 1d dimensional > thing? > Can you clarify what you mean by dimensionality sense and specifically 1d here? You can have a 1d array which is different from what your pr

Re: [Rd] Testing for vectors

2018-07-07 Thread Hadley Wickham
On Sat, Jul 7, 2018 at 12:54 PM, Duncan Murdoch wrote: > On 07/07/2018 1:20 PM, Hadley Wickham wrote: >> >> Hi all, >> >> Is there are base function that I've missed that tests if an object is >> a vector in the dimensionality sense, rather than the data structure >> sense? i.e. something that che

Re: [Rd] Testing for vectors

2018-07-07 Thread Duncan Murdoch
On 07/07/2018 1:20 PM, Hadley Wickham wrote: Hi all, Is there are base function that I've missed that tests if an object is a vector in the dimensionality sense, rather than the data structure sense? i.e. something that checks is.null(dim(x)) ? is.vector() is trivially disqualified since it als

[Rd] Testing for vectors

2018-07-07 Thread Hadley Wickham
Hi all, Is there are base function that I've missed that tests if an object is a vector in the dimensionality sense, rather than the data structure sense? i.e. something that checks is.null(dim(x)) ? is.vector() is trivially disqualified since it also checks for the presence of non-names attribut