[R] why should you set the mode in a vector?

2004-10-29 Thread Joel Bremson
Hi all, If I write v = vector(mode=numeric,length=10) I'm still allowed to assign non-numerics to v. Furthermore, R figures out what kind of vector I've got anyway when I use the mode() function. So what is it that assigning a mode does? Joel __

Re: [R] why should you set the mode in a vector?

2004-10-29 Thread Tony Plate
It's useful when you need to be certain of the mode of a vector. One such situation is when you are about to call a C-language function using the .C() interface. As you point out, some assignments (even just to vector elements) can change the mode of the entire vector. This is why it's