how i can reach in result using $ or [ ]

how i can find out in result which 3 values are matched and want to use those values please help

library(sf)
#> Linking to GEOS 3.6.1, GDAL 2.2.3, PROJ 4.9.3
    p1 <- data.frame(
      lat=as.integer(runif(5,29,32)),
      long=as.integer(runif(5,69,74))
    )%>%
      st_as_sf(coords = c("lat","long"), crs = 4326)
       p2 <- data.frame(
      lat=as.integer(runif(5,29,32)),
      long=as.integer(runif(5,69,74))
    ) %>%
      st_as_sf(coords = c("lat","long"), crs = 4326)
   
   #nrow(st_join(p1,p2, join = st_equals, left = F)) == nrow(p1)
       i=nrow(st_join(p1,p2, join = st_equals, left = F)) 
       i
#> [1] 3 i want to find these 3 values HOW?

Created on 2020-02-15 by the reprex package (v0.3.0)

Hi,

Could you tell us a bit more what you exactly want to do. I don't understand 'which 3 values are matched' and the result you generate at the end (i) is empty. Please make sure you have a reprex that can recreate the situation you want and provide more details so we know what the problem is you're trying to solve.

Good luck,
PJ

Could you run st_join(p1,p2, join = st_equals, left = F)? The 3 came from applying nrow() to the output of this command.

1 Like

yes
3 values are matched in p1 and p2 how i come to know which 3 values are matched?

If you run st_join(p1,p2, join = st_equals, left = F) you'll be able to see which points matched. If you run nrow(st_join(p1,p2, join = st_equals, left = F)) you'll only be able to the number of matches that occurred. Does that make sense?

1 Like

10 posts were merged into an existing topic: error in last step (its not converting onlinecluster and instorecustomer in vector)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.