Skip to content
Back to formatted view

Raw Message

Message-ID: <28fddd$f61ddh@ironport10.mayo.edu>
Date: 2020-12-28T12:46:43Z
From: Terry Therneau
Subject: .Fortran to .Call

Roger,
 ?Over the years I have converted many of the .C calls in the survival package to .Call.? 
As others have said, the big advantage is memory footprint.? I did it because there are a 
few users who call survfit or coxph with really large data sets, and not copying the data 
can be the difference between success and failure (run out of memory).? Like you, my 
experience has been that if there is enough memory, then the time required for .C or 
.Fortran to make the data copy is minimal.?? Don't make the change in order to gain 
compute speed.

The downside to .Call is that R then makes the (dangerous) assumption that you know what 
you are doing.? That is, vectors/matrices that are passed in to the function will NOT have 
new data values written into them, unless you have taken the necessary steps.?? Breaking 
the promise can lead to program failures that are very hard to track down.

-- 
Terry M Therneau, PhD
Department of Health Science Research
Mayo Clinic
therneau at mayo.edu

"TERR-ree THUR-noh"


	[[alternative HTML version deleted]]