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

Standardize column names of returned spsample coordinates #58

Closed
samuel-rosa opened this issue Sep 15, 2019 · 3 comments
Closed

Standardize column names of returned spsample coordinates #58

samuel-rosa opened this issue Sep 15, 2019 · 3 comments

Comments

@samuel-rosa
Copy link
Contributor

Coordinates returned by spsample can have different names depending on the sampling method used. For instance, random and hexagonal sampling return coordinate pairs named x and y, while for regular and nonaligned sampling coordinate pairs are named x1 and x2. the reason for this is that the last two make use of makegrid0 to generate the samples, a function that contains the following line of code inside a for-loop:

name = paste("x", i, sep = "")

I think that it is important to standardize the outputs of spsample so that others can make a more efficient use of spsample. For instance, this could be done by placing the following line o code at the end of the makegrid0 function definition:

colnames(xy) <- c('x', 'y')
@edzer
Copy link
Owner

edzer commented Sep 15, 2019

I agree that might be nicer, but I essentially only change things in sp if it fixes bugs.

@edzer edzer closed this as completed Sep 15, 2019
@samuel-rosa
Copy link
Contributor Author

I understand. Would you be willing to mention this naming convention in the documentation, for example, in the notes?

@edzer
Copy link
Owner

edzer commented Sep 15, 2019

Please feel free to submit a PR for that.

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