Skip to content

Make duplicated and unique work (fixes #2138) #2140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 3, 2023
Merged

Conversation

bart1
Copy link
Contributor

@bart1 bart1 commented Mar 31, 2023

add a duplicated.sf method so unique and duplicated work with factor column in the data.frame

@bart1
Copy link
Contributor Author

bart1 commented Apr 3, 2023

@edzer I guess the tic error is unrelated to the pull request right? or is there a way to prevent it?

@edzer
Copy link
Member

edzer commented Apr 3, 2023

That's right.

@edzer edzer merged commit ee7c7e4 into r-spatial:main Apr 3, 2023
edzer added a commit that referenced this pull request Apr 3, 2023
@edzer
Copy link
Member

edzer commented Apr 3, 2023

Thanks!

@jmaspons
Copy link

Does the function take into account the geometries to determine duplicated rows? I could not find any docs

@bart1
Copy link
Contributor Author

bart1 commented Jun 27, 2025

Does the function take into account the geometries to determine duplicated rows? I could not find any docs

yes:

require(sf)
#> Loading required package: sf
#> Linking to GEOS 3.10.2, GDAL 3.4.1, PROJ 8.2.1; sf_use_s2() is TRUE
st_as_sf(data.frame(x=c(1,1),y=2), coords = 1:2) |> duplicated()
#> [1] FALSE  TRUE
st_as_sf(data.frame(x=c(1,3),y=2), coords = 1:2) |> duplicated()
#> [1] FALSE FALSE

Created on 2025-06-27 with reprex v2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants