Giter Club home page Giter Club logo

sugarbag's People

Contributors

dicook avatar mattcowgill avatar mitchelloharawild avatar srkobakian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sugarbag's Issues

Be explicit if variable is a data or env variable in dplyr verbs

My centroids data had an x variable. This caused an issue downstream where lat_window was calculated as it was using the x in the centroids data instead of x in the environment (e.g. below with .env$x[1]).

lat_window <- function(x, cents = centroids, maximum = nlat) {
    max_int <- min(x[2], maximum)

    cents_in <- filter(cents, between(lat_int, .env$x[1], max_int))
    return(cents_in)
  }

Release sugarbag 0.1.0

Prepare for release:

  • Check that description is informative
  • Check licensing of included files
  • usethis::use_cran_comments()
  • devtools::check()
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • Polish pkgdown reference index
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('minor')
  • Update cran-comments.md
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • usethis::use_news()
  • Update install instructions in README
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

`allocate()` fails when `focal_points` is not specified

The allocate() function assigns each geographical area to a hexagon on a pre-created grid.

allocate() has an argument focal_points. Users can supply a data frame of coordinates of map focal points, which are used to choose hex locations for each area that maximally preserve the relationship of the area to the focal point(s). A data frame capital_cities is provided containing lon/lat coordinates of Australian capital cities. This dataframe is used in the README example.

However, allocate() should work when focal_points = NULL, the default for the function. Line 85 in allocate.R contains code that should (I think) create a single focal point as the mean of all area centroids in the data where focal_points = NULL. But instead allocate() returns an error before getting to this point.

allocate() should work without focal point(s) being specified.

readme typo?

There seems to be two LNP in the readme:

auscolours <- c(
  "ALP" = "#DE3533",
  "LNP" = "#080CAB",
  "KAP" = "#b50204",
  "GRN" = "#10C25B",
  "XEN" = "#ff6300",
  "LNP" = "#0047AB",
  "IND" = "#307560")

break in while loop needed

while(NROW(f_grid) == 0) {
f_grid <- filter_grid_points(f_grid = hex_grid, f_centroid = centroid, f_dist = filter_dist)
if (NROW(f_grid) == 0) {
filter_dist <- filter_dist*1.5
print(paste("Filter Distance expanded 50% to ", filter_dist))
}
}

The endless loop occurs because there are no more available points in the direction, with the current buffer. You should be able to work out a maximum expansion size possible, based on the largest inter-grid point distance. When you reach this, break out of the while loop, print a warning to the user, and allocate to a randomly available grid point.

Expanding the buffer fixes the endless loop, temporarily.

"while"'s always need an escape route

Expanding filter distance

Intended flow:
While no possible hexagon is available -> expand area considered to 1.5x original distance -> return points now available in the range

Current flow:
While no possible hexagon is available -> expand area considered to 1.5x original distance -> continues to expand, cannot break from while loop?

Remove hard coded variables in centroids or add documentation on structure

E.g. for create_grids, it wasn't obvious to me that the centroids argument required a data frame with variables explicitly named longitude and latitude. A flexibility to refer to any columns for lat and lon is desirable IMO. That way I don't need an intermediate step to create a data frame with latitude and longitude.

(happy to do pull request on this if you like)

Example code for data

For the data sets provided, add some code to show the data, and what would be done with the data. It might need to be wrapped in a don't run to satisfy CRAN

Not able to install

> devtools::install_github("srkobakian/sugaRbag")
Downloading GitHub repo srkobakian/sugaRbag@master
✔  checking for file ‘/tmp/RtmpsZ4m0W/remotes461426473b70/srkobakian-sugaRbag-892d988/DESCRIPTION’ ...
─  preparing ‘sugaRbag’:
✔  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  looking to see if a ‘data/datalist’ file should be added
─  building ‘sugaRbag_0.0.0.9000.tar.gz’ (1.3s)
   
Installing package into ‘/home/hyndman/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
* installing *source* package ‘sugaRbag’ ...
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘sugaRbag’ in namespaceExport(ns, exports):
 undefined exports: sfc_to_tibble
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/hyndman/R/x86_64-pc-linux-gnu-library/3.5/sugaRbag’
Error in i.p(...) : 
  (converted from warning) installation of package ‘/tmp/RtmpsZ4m0W/file46141c79307c/sugaRbag_0.0.0.9000.tar.gz’ had non-zero exit status

vignette

when on downtime, needing something basic to do, write vignette

Examples

Develop a goodie bag of examples using the cancer data, to show off all sorts of aspects of the package

geofacet

We want to be able to facet small chunks of the map, but the position in the facet should roughly match the geographic location. Like the geofacet package, but it only has US state layout currently. We would need to do a rough layout.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.