GithubHelp home page GithubHelp logo

geocompx / geocompkg Goto Github PK

View Code? Open in Web Editor NEW
21.0 5.0 12.0 39.14 MB

A metapackage containing vignettes used in the book Geocomputation with R

Home Page: https://geocompx.github.io/geocompkg/

License: Other

R 6.22% TeX 93.78%
r spatial geocomputation

geocompkg's Introduction

R build status R build status

geocompkg

This is a ‘metapackage’ support the book Gecomputation with R. Installing installing it will give you the dependencies needed to run the code in the book. The repository also contains additional materials to supplement the book. See the vignettes folder for the source code.

Installation

You can install the packages needed to reproduce the code in Geocompuation with R by installing the geocompkg package as follows:

devtools::install_github("geocompx/geocompkg")

Alternatively, you may install this package using the R-universe repository:

options(repos = c(
  geocompx = 'https://geocompx.r-universe.dev',
  cran = 'https://cloud.r-project.org'
))
install.packages("geocompkg")

If you have any issues, check-out Chapter 2 of the book.

geocompkg's People

Contributors

darrellcarvalho avatar dhersz avatar jannes-m avatar nowosad avatar robinlovelace avatar zmbc avatar

Stargazers

 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

geocompkg's Issues

Not sure where to edit - error Chap 4 solution

Hi! Not sure where to put the pull request for the solutions.html

Code as in solutions:

canterbury = nz %>% filter(Name == "Canterbury Region")
canterbury_height = nz_height[canterbury, ]
nrow(canterbury_height) # answer: 61

Problem:

 Canterbury Region" %in% nz$Name
 [1] FALSE
 "Canterbury" %in% nz$Name
 [1] TRUE

Suggested solution:

canterbury = nz %>% filter(Name == "Canterbury")
canterbury_height = nz_height[canterbury, ]
nrow(canterbury_height) # answer: 70

Reduce reliance on dev versions of packages

We still rely on 4 packages not on CRAN:

    mlr-org/mlr3extralearners,
    mlr-org/mlr3spatiotempcv,
    mlr-org/mlr3proba,
    paleolimbot/qgisprocess,
    nowosad/spDataLarge,

An issue associated with this is that if you run

remotes::install_github("geocompr/geocompkg", dependencies = TRUE)

On the majority of computers that have not been authenticated with GitHub, you may get an error message along the lines of the following, if other packages have been installed from GitHub:

Downloading GitHub repo mlr-org/mlr3proba@HEAD
Downloading GitHub repo alan-turing-institute/distr6@HEAD
Error: Failed to install 'unknown package' from GitHub:
  Failed to install 'unknown package' from GitHub:
  Failed to install 'unknown package' from GitHub:
  Failed to install 'unknown package' from GitHub:
  HTTP error 403.
  API rate limit exceeded for 51.154.68.67. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

  Rate limit remaining: 0/60
  Rate limit reset at: 2023-05-21 12:08:42 UTC

  To increase your GitHub API rate limit
  - Use `usethis::create_github_token()` to create a Personal Access Token.
  - Use `usethis::edit_r_environ()` and add the token as `GITHUB_PAT`.

This is not good for reproducibility, especially for beginners. Is there any way we can move away from dependency on any of these GitHub packages or can we help their maintainers submit to CRAN?

Thoughts v. welcome @jannes-m and @Nowosad or anyone.

Blog post on animating trajectories

I've been experimenting with this and have some examples:

https://nostalgic-murdock-528b70.netlify.app/2021/01/21/adeeb/map.gif

and

Peek 2021-09-06 23-34

Unfortunately there seem to be severe limitations on what is currently possible in this space: no easy way to add a time slider as far as I can tell. Heads-up @tim-salabim just in case but I plan to write a post showing how to get the basics going and doing a bit of a 'call for developer' time to solve what should be a fairly straightforward problem. On a related note, it's pretty amazing to see what is possible in animated web mapping these days:

Peek 2021-09-06 23-39

Source: https://avs.auto/demo/index.html

Not able to reproduce the figure 2.5 (page 27)

Complete novice in geocomputation and trying to work through examples in the book.
I'm trying to recreate the figure 2.5 - I'm not able to get the longitude and latitude "lines".

library(sf)
#> Linking to GEOS 3.6.1, GDAL 2.2.3, PROJ 4.9.3
library(spData)

cex <- sqrt(world$pop)/1e4
world_cents <- st_centroid(world, of_largest = TRUE)
#> Warning in st_centroid.sf(world, of_largest = TRUE): st_centroid assumes
#> attributes are constant over geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for
#> longitude/latitude data

plot(world["continent"], reset  = FALSE)
plot(st_geometry(world_cents), add = TRUE, cex = cex)

sessionInfo()
#> R version 3.6.1 (2019-07-05)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 10 x64 (build 16299)
#> 
#> Matrix products: default
#> 
#> locale:
#> [1] LC_COLLATE=English_United States.1252 
#> [2] LC_CTYPE=English_United States.1252   
#> [3] LC_MONETARY=English_United States.1252
#> [4] LC_NUMERIC=C                          
#> [5] LC_TIME=English_United States.1252    
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] spData_0.3.2 sf_0.8-0    
#> 
#> loaded via a namespace (and not attached):
#>  [1] Rcpp_1.0.2         class_7.3-15       digest_0.6.21     
#>  [4] spDataLarge_0.3.1  grid_3.6.1         DBI_1.0.0         
#>  [7] magrittr_1.5       units_0.6-5        e1071_1.7-2       
#> [10] evaluate_0.14      KernSmooth_2.23-15 highr_0.8         
#> [13] rlang_0.4.0        stringi_1.4.3      rmarkdown_1.16    
#> [16] tools_3.6.1        stringr_1.4.0      xfun_0.10         
#> [19] yaml_2.2.0         compiler_3.6.1     classInt_0.4-1    
#> [22] htmltools_0.4.0    knitr_1.25

Created on 2019-10-10 by the reprex package (v0.3.0)

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.