#2075 closed enhancement (fixed)

R modules sp and sf

Reported by: darkblueb Owned by: osgeolive@…
Priority: major Milestone: OSGeoLive12.0
Component: OSGeoLive Keywords: R
Cc: edzer

Description

12dev alpha1; this ticket tracks the install of R modules sp and sf

note this ticket supersedes #998

dr. robin lovelace writes:

I would agree with the statement that sf is essential. Further I would say RStudio is all-but essential. I proposed adding it on the osgeolive list over a year ago so am very happy to see this get rejuvenated as a plan. I think a good list of important geo packages is that in the rocker/geospatial container: https://hub.docker.com/r/rocker/geospatial/~/dockerfile/

Hope this is useful, look forward to hearing about (and perhaps installing) osgeolive bionic, can't wait''

Attachments (1)

sf_jupyter_R.tgz (202.9 KB) - added by darkblueb 16 months ago.
six ipynb->html R notebooks, including errors

Download all attachments as: .zip

Change history (14)

comment:1 Changed 17 months ago by darkblueb

.. further investigations on the R rocker/geospatial docker world (23 layers, 1.3GB)

sudo docker pull rocker/geospatial; sudo docker run -ti rocker/geospatial bash

It is a full linux in there, with /libs and /docs As is often the case with R, the docs are quite nice Specifically I found a part where they discuss native performance with gdal and GEOS. gdal provides a postgres connector, and it reads PostGIS directly and, WKT and WKB can be read, and the Shapefile driver. They claim near-native performance on all of those.. 20x of the previous rgdal or whatever

no benchmarks yet.. the important item at osgeolive is installing sf with docs that are acceptable to the R team.

comment:2 Changed 17 months ago by darkblueb

Reading the R geospatial writings describing the rocker project.. it seems like somewhere around 6% of R on linux users show enough interest in geospatial to try the geospatial flavor docker container.. but, geospatial was included very early in the project, proving that geospatial has a special significance, despite low raw numbers of users

The Impressive Growth of R - Stack Overflow Blog (at stackoverflow.blog)

https://stackoverflow.blog/2017/10/10/impressive-growth-r/

.. academic social sciences, biology .. gotcha

Said another way, it seems like .. a primary reason to learn and use R is population studies in academia, which obviously use maps, but only a small percentage of those users are using maps or trying to use maps, today. Every single thing you do in R is hard.. so it is not because maps are too hard.

(analogy qwerty keyboard and R language syntax)

News flash -- one year ago, the RStudio project made an exact parallel to Jupyter Notebooks, called R Notebooks, and a file format called dot Rmd

detailed review comparing the two:

http://minimaxir.com/2017/06/r-notebooks/

Advantages of Using R Notebooks For Data Analysis Instead of Jupyter Notebooks (at minimaxir.com)

other notable quotes from the comments section of the R Notebooks review: "... the vast majority of R use from universities is by researchers, which we can tell since it doesn’t dip in the summer." "I think RStudio played an important role for the popularity of R."

Last edited 17 months ago by darkblueb (previous) (diff)

comment:3 Changed 17 months ago by darkblueb

authoritative reference of R modules for geospatial -LINK- https://cran.r-project.org/web/views/Spatial.html

comment:4 Changed 17 months ago by darkblueb

12dev alpha1;

succesfull install of sf via CRAN using four lines.. requires C++ and gfortran ; harmlessly links to existing GEOS, GDAL and Proj4 ; multistage C++ build locally ; improvements welcome

https://git.osgeo.org/gitea/osgeolive/OSGeoLive/pulls/14

Last edited 17 months ago by darkblueb (previous) (diff)

comment:5 Changed 17 months ago by edzer

Great! You probably also want to include package lwgeom then, as it is needed by sf for all the computations on long/lat coordinates (just like geography in PostGIS). It links either externally to liblwgeom-dev if available, otherwise compiles its own (private) copy of that library.

comment:6 Changed 17 months ago by darkblueb

Priority: normalmajor

comment:7 Changed 17 months ago by darkblueb

Tim Appelhans writes:

If I can be of any help let me know.

On 06/29/2018 09:20 PM, Edzer Pebesma wrote:

Hi Brian, most users as far as I know who use R don't use R from Jupyter

  • I'm not sure why one would want this, most people use Rstudio these

days (I don't, and that's considered old fashioned).

As of mapview (Cc: Tim), if R package leaflet works in Jupyter, then mapview will.

Well, let's say that 80% of functionality should work if leaflet works. There are some stand-alone htmlwidgets (e.g. cubeview) that may need some attention. I have never tried using R from jupyter, so have no idea what is needed to get things to work...

Edzer, regarding all the web-based rendering such as leaflet / mapview or other htmlwidgets (eg. plotly) you are wise not to work in RStudio, as the viewer usually causes more trouble than being helpful. All that ported js code is written for the browser so will work best there (unless you use IE, but who does that?). I find myself setting optins(viewer = NULL) way more often than I'd like, but it's better than crashing the whole RStudio (and hence R) instance just because you want to render something for quick inspection.

comment:8 Changed 17 months ago by darkblueb

test in branch notebooktest

comment:9 Changed 16 months ago by darkblueb

testing sf on branch notebooktest

(see attached ipynb->html files)

comment:10 Changed 16 months ago by darkblueb

Cc: edzer added

Changed 16 months ago by darkblueb

Attachment: sf_jupyter_R.tgz added

six ipynb->html R notebooks, including errors

comment:11 Changed 15 months ago by darkblueb

12dev beta2

R Notebooks enabled

comment:13 Changed 14 months ago by bakaniko

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.