[R] Using .Fortran in R - how can I use file i/o flexibly OR arrays of variable length as arguments?

Peter Green m@pjg @end|ng |rom br|@to|@@c@uk
Sat Feb 5 14:58:46 CET 2022


>> Any thought on the other route I suggested, that is, binary file i/o
>> from with the Fortran code (e.g. full use of the connections
>> functionality), again perhaps via C?
> I think that Fortran I/O is only forbidden when it comes to units * and
> 6. It should be allowed to open a unit, use unformatted I/O to write an
> array into it and readBin() back on the R side.
>
> On the other hand, the use of connections means that we're calling into
> R, which means that we have to interact with the garbage collector. It's
> easier to just return the values to R in that case.

Thank you, Ivan - you've detected an unusual example of my 
over-interpreting, rather than underestimating something in Writing R 
extensions!

Peter



More information about the R-help mailing list