Displaying 2 results from an estimated 2 matches for "mysetdiff".
2008 Feb 09
1
error in the function
Dear lists,
i want to find the non-overlapping interval values with this code:
mysetdiff=function(x,y){
m=length(x)
n=length(y)
bx = logical(m)
by = logical(n)
for(i in 1:m){
for(j in 1:n){
if(x[i]<=y[j+1]){
bx[i] = T
by[j] = T
NA = NA
}
}
}
sx = x[!bx]
sy = y[!by]
s=c(sx,sy)
return(s)
}
Below is my da...
2008 Feb 08
1
remove the missing value,NA
I have two sets of interval data.Below are my two dataset. In these dataset, there is a missing values in each of the data. I want to find the non-overlapping interval values. Here is my code:
mysetdiff=function(x,y){
m=length(x)
n=length(y)
bx = logical(m)
by = logical(n)
for(i in 1:m){
for(j in 1:n){
if(x[i]<=y[j]){
bx[i] = T
by[j] = T
}
}
}
sx = x[!bx]
sy = y[!by]
s=c(sx,sy)
return(s)
}
How am i going to remove the NA val...