Giter Site home page Giter Site logo

fraster's Introduction

FrasteR

Templates for Fortran inter-operation from R, using raster data.

Users new to R-Fortran inter-operation or those returning to it intermittently can easily forget details of indexing and data marshalling. This repository provides a set of working examples to lower the setup overhead of getting your R-Fortran project running. The aim is to provide boilerplate code for handling inter-operation details so that users can immediately focus on Fortran solutions. Fortran programmers wishing to take advantage of R as an interface to various data types may also benefit. The routines provided examine trivial cases but should be easy to extend. Automated unit tests are provided for all routines via a makefile.

Simple cases of calling Fortran subroutines from R are provided in Simple.R/f90. These examples demonstrate vector, matrix and array data passing to and from Fortran subroutines. The unit tests provide simple use cases which may be used as a tutorial. Once the basics of those operations are understood, working with Raster* objects is easy. Final examples demonstrate cases where RasterLayer and RasterBrick objects are decomposed, passed to Fortran and reconstructed as Raster* objects on return.

Each of the examples mentioned to this point duplicate functionality already available in R or the raster package. Typically users will be interested in cases where Fortran calls provide functionality which is not otherwise available. Some suggestions for seeding such routines, with an emphasis on Raster* objects, will be provided in FrasteR.R/f90.

Unit tests are provided at inst/tests using the testthat framework. Testing can be automated using the makefile to further streamline development.

  • make autotest builds a local copy of the package and runs the test suite

  • make clean restores the file tree to a state suitable for R CMD check.

It is possible that the makefile will be extended to include a target which will appropriately purge/rename the src tree to facilitate new project development.

Fortran Best Practices is a useful resource.

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.