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

Remove references to geneorama #40

Open
geneorama opened this issue Jul 13, 2017 · 0 comments
Open

Remove references to geneorama #40

geneorama opened this issue Jul 13, 2017 · 0 comments

Comments

@geneorama
Copy link
Member

I'm using my package here and there, this should be sanitized of geneorama functions. The only really important function is the shift function, which has a data.table analogue, but I wrote my version first and our versions are different. So that could be confusing if geneorama were not available.

Functions being used:

  • loadinstall_libraries - loads libraries, installs them if they're missing. This is only for convenience when testing on different machines. This can be changed to library (although we might need to add some error handling for the script that's using rgdal, which isn't installed on the development server).
  • shift - basically a lag operator. I'll just make a copy of the function in this project.
  • sourceDir - sources all the files in a directory, I'll just make a copy of this function in the project
  • naSummary - Summarizes NA and unique values in a dataset - I can just make a copy of this function
  • Other convenience functions like clipper and the one that writes temp files can be omitted completely.
  • I think there might be some other functions in geneorama which are already copied into the project, like the ones that translate between xy coordinates and lat / lon

The shift function:

shift <- function (x, offset = 1, pad = NA) {
    r <- (1 + offset):(length(x) + offset)
    r[r < 1] <- NA
    ans <- x[r]
    ans[is.na(ans)] <- pad
    return(ans)
}
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

1 participant