lutraconsulting / MDAL

Mesh Data Abstraction Library
http://www.mdal.xyz/
MIT License
160 stars 50 forks source link

R package for mdal (rmdal) #42

Open saberraz opened 5 years ago

saberraz commented 5 years ago

It will be great to have R package for mdal CC @mdsumner

PeterPetrik commented 5 years ago

https://cran.r-project.org/doc/manuals/r-release/R-exts.html

mdsumner commented 5 years ago

I meant to say something here, I'm very keen to help - but I still have zero experience with MDAL itself, and I'm pretty slow at anything C++!

I can definitely help with anything to do with R packaging though, and once I can get a minimal example going I tend to be able to muddle along. I've been meaning to try this and hope to soon.

I'd suggest that https://github.com/r-spatial/sf is a good example of wrapping a C++ library ( GDAL, and others), but it's also very large and complicated.

A much simpler wrapping of GDAL is here, I saved this first-success as a record for myself of how to do it: https://github.com/diminutive/gdalmin (it might be a bit stale now, but does list all the structure that's required).

For starting a package in R, the best way is to get the latest R and the latest RStudio, and install packages:

install.packages(c("devtools", "usethis"))

Then, create a package with

usethis::create_package("/path/to/mypkg")

To augment Writing R Extensions, the best reference is http://r-pkgs.had.co.nz/ with advanced topics in http://adv-r.had.co.nz/.

If any of that's helpful (or not) I'm keen to pursue further. I also just pushed out a new version of quadmesh to CRAN, which might be a way to get first examples to visualization going.

https://CRAN.R-project.org/package=quadmesh