Skip to content
Prev 369997 / 398503 Next

Help: ifelse selection for x,y coordinates

Hi Jim,

Thank you very much for the answer?! The result is really better with this??

Here is the code?:
+ { 
+   coordx<-data$x.Koordinate[data$G==24]
+   coordy<-data$y.Koordinate[data$G==24]
+   x <- ifelse(data$x.Koordinate>coordx-51 & data$G>15,data$x.Koordinate," ")
+   y<-ifelse(data$y.Koordinate>coordy-51 & data$G>15,data$y.Koordinate," ")
+   xy<-as.data.frame(list(x,y))
+   names(xy)<-c("x","y")
+   return(xy)
+ }
x      y
1               
2               
3               
4               
5               
6  205550       
7  205550 604100
8               
9  205600 604150
10 205600 604100

Best regards,
C.


Gesendet von Mail f?r Windows 10

Von: Jim Lemon
Gesendet: vendredi, 23 juin 2017 05:28
An: C?line L?scher
Cc: r-help at r-project.org
Betreff: Re: [R] Help: ifelse selection for x,y coordinates

Hi Celine,
Perhaps if you modify your return value like this:

xy<-as.data.frame(list(x,y))
names(xy)<-c("x","y")
return(xy)

Jim
On Thu, Jun 22, 2017 at 6:48 PM, C?line L?scher <c-luescher at hispeed.ch> wrote: