Re[2]: [R] problems with subset (misunderstanding somewhere)

2005-04-05 Thread Wladimir Eremeev
Ted, TH> Did you test the function cubic.distance? Yes, I did. TH> As written, I think it TH> will always return a single value, Yes, here was the misunderstanding. Subset required a vector, and I gave it a scalar. Prof. Ripley has already shown my mistake. -- Best regards Wladimir Eremeev

RE: [R] problems with subset (misunderstanding somewhere)

2005-04-05 Thread Ted Harding
On 05-Apr-05 Wladimir Eremeev wrote: > Dear r-help, > > I have the following function defined: > > cubic.distance<-function(x1,y1,z1,x2,y2,z2) { > max(c(abs(x1-x2),abs(y1-y2),abs(z1-z2))) > } > > I have a data frame from which I make subsets. > > When I call > subset(dataframe,cubic.distanc

Re: [R] problems with subset (misunderstanding somewhere)

2005-04-05 Thread Prof Brian Ripley
On Tue, 5 Apr 2005, Wladimir Eremeev wrote: Dear r-help, I have the following function defined: cubic.distance<-function(x1,y1,z1,x2,y2,z2) { max(c(abs(x1-x2),abs(y1-y2),abs(z1-z2))) } I have a data frame from which I make subsets. When I call subset(dataframe,cubic.distance(tb19h,tb37v,tb19v,190

[R] problems with subset (misunderstanding somewhere)

2005-04-05 Thread Wladimir Eremeev
Dear r-help, I have the following function defined: cubic.distance<-function(x1,y1,z1,x2,y2,z2) { max(c(abs(x1-x2),abs(y1-y2),abs(z1-z2))) } I have a data frame from which I make subsets. When I call subset(dataframe,cubic.distance(tb19h,tb37v,tb19v,190,210,227)<=2) I have the result with 0