Re: [R] Pesky homemade function code

2010-09-16 Thread Rafael Björk
Checking on the function 'combinations' in gplot i find this: if (mode(n) != "numeric" || length(n) != 1 || n < 1 || (n%%1) != 0) stop("bad value of n") So essentially, the argument 'length(data$times[data$ids == id[1]])' in the line 'combinations(length(data$times[data$ids == id[

Re: [R] Pesky homemade function code

2010-09-16 Thread Sebastian Gibb
Hello, why you don't use the last 3 arguments? >semivario=function(data,ids,times,resids){ > id=unique(data$ids) ... It seems "data" be a list. In that case the last 3 arguments are useless. Could you please send us a runable code example. That means some example data and your all neede functions

Re: [R] Pesky homemade function code

2010-09-16 Thread trekvana
@Thierry- I am writing my own semivariogram code since I could not find a pre-made function that did what I need it do. The code in the function correctly works but I not sure how to get the function itself to work. In other words if I fill in the commands (hope,id,sctime,scResid) by hand then ev

Re: [R] Pesky homemade function code

2010-09-16 Thread ONKELINX, Thierry
r-help@r-project.org > Onderwerp: [R] Pesky homemade function code > > > Hi all- > > this seems to be simple to figure out but since im new to > writing functions I dont know what is happening. Here is my > code along with the error I am > receiving: > &

[R] Pesky homemade function code

2010-09-15 Thread trekvana
Hi all- this seems to be simple to figure out but since im new to writing functions I dont know what is happening. Here is my code along with the error I am receiving: semivario=function(data,ids,times,resids){ id=unique(data$ids) index=combinations(length(data$times[data$ids==id[1]]),2) time=ga