Skip to content
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

Use of numeric coordinates #11

Open
JolleJolles opened this issue May 1, 2020 · 2 comments
Open

Use of numeric coordinates #11

JolleJolles opened this issue May 1, 2020 · 2 comments

Comments

@JolleJolles
Copy link

I am trying to get concaveman to work with a matrix of spatial (numeric) coordinates, e.g. like mat <- matrix(c(c(1,1),c(3,1),c(2,4)), ncol=2). How can I make this work?

In the description it is stated "points can be represented as a matrix of coordinates", but not that these points cannot be numeric or how to convert them.

I came upon your package via the ggforce package, which does a great job in plotting my points with the concave hull, but I don't know how to extract the computed points.

@JolleJolles JolleJolles changed the title Use of spatial coordinates Use of numeric coordinates May 1, 2020
@JolleJolles
Copy link
Author

I found that the following command helps to get the right data for concaveman from a dataframe with x,y data: dat_sf <- st_as_sf(data,c("x","y")], coords = c("x", "y"), crs = 28992), but any further clarifications would be appreciated.

@joelgombin
Copy link
Owner

joelgombin commented May 10, 2020

I'm not quite sure what your question is. The following works for me:

mat <- matrix(c(c(1,1),c(3,1),c(2,4)), ncol=2)

library(concaveman)
concaveman(mat)

Could you provide a reprex of something you wish worked but doesn't?

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

No branches or pull requests

2 participants