humaniverse / geographr

R package for mapping UK geographies
https://humaniverse.github.io/geographr/
Other
39 stars 7 forks source link

install fails on pre R 4.1 due to native pipe in calculate.r #22

Closed andysouth closed 2 years ago

andysouth commented 2 years ago

Thanks for the package. I've been looking for a work excuse to try it out for a while.

Finally have a use case to look at, but unfortunately the installation fails on the oldish versions of R, I have on my personal & work systems. Whilst its easy to change my personal one less so the work one.

Seems to be due to the native pipe |> introduced in R 4.1.

I wonder if the benefit of using the native pipe is outweighed by the fact that it will make it harder for some users like me ?

If you do decide to keep the pipe you should probably change DESCRIPTION to depend on R >= 4.1.

Looking forward to trying it out.

> install_github("britishredcrosssociety/geographr")
Downloading GitHub repo britishredcrosssociety/geographr@HEAD
√  checking for file 'C:\Users\andy.south\AppData\Local\Temp\RtmpCCBf4J\remotes4d08eee2465\humaniverse-geographr-a90705b/DESCRIPTION' (1s)
-  preparing 'geographr': (1.6s)
√  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
-  building 'geographr_0.0.0.9000.tar.gz' (559ms)

* installing *source* package 'geographr' ...
** using staged installation
** R
Error in parse(outFile) : 
  C:/Users/andy.south/AppData/Local/Temp/RtmpcVRwNh/R.INSTALL1173062d1583e/geographr/R/calculate.R:46:13: unexpected '>'
45:     data <-
46:       data |>
                ^
ERROR: unable to collate and parse R files for package 'geographr'
* removing 'C:/R/R-4.0.3/library/geographr'
MikeJohnPage commented 2 years ago

Thanks for checking out the package.

I've done a bunch of development work on the package today to make it more robust including:

If you try and reinstall the package, I'm hopeful it will be successful this time.

Please note, this package has been developed on an ad hoc basis to meet development needs in at the British Red Cross. An official version 1 release is on the horizon which should hopefully provide a more robust API.

MikeJohnPage commented 2 years ago

Also note, the lookup tables have been depreciated during this development work, but will be added back in soon in an updated format.

andysouth commented 2 years ago

Many thanks @MikeJohnPage, appreciate your efforts and sharing. Installation does now warn me that it is not compatible with R < 4.1. I'll close this for now, and have a proper go with it when I find time to update my R installation. All the best.