my experience with rBAPS
Oslo Centre for Biostatistics and Epidemiology, UiO
2024-05-30
Translate core functionality of BAPS from MATLAB to R
(buckle up, kiddos)
Go from top-level functions down the rabbit hole or the other way around?
Aspect | ⬇ Top-down | ⬆ Bottom-up |
---|---|---|
Chance for errors | Higher | Lower |
Chance to waste coding | Lower | Higher |
Initial speed | Fast | Slow |
Result: 4 years of “one step forward, one step back”
<rant><matlab>
“WTF are these shortcuts? Alt+WAlt+W to copy? Ctrl+YCtrl+Y pastes?”
FWIW this is all fixed in MATLAB Online
Things got way better using MATLAB on VSC
No default values for function arguments? WTF is this nargin()
, nargout()
?
Is abc()
a function call or a subset?
if testaaPop(line3)==1
%2 rivi tällöin lokusrivi
nloci = rivinSisaltamienMjonojenLkm(line2);
line4 = fgetl(fid);
if isequal(line4,-1)
disp('Incorrect file format'); fclose(fid);
return
end
if ~any(line4==',')
% Rivin nelj?täytyy sisältää pilkku.
disp('Incorrect file format'); fclose(fid);
return
end
pointer = 1;
while ~isequal(line4(pointer),',') %Tiedetään, ett?pysähtyy
pointer = pointer+1;
end
line4 = line4(pointer+1:end); %pilkun jälkeinen osa
nloci2 = rivinSisaltamienMjonojenLkm(line4);
if (nloci2~=nloci)
disp('Incorrect file format'); fclose(fid);
return
end
end
</matlab><r>
Object |
|
|
|
|
|
Object |
|
|
|
|
|
|
|
|
Object |
|
|
|
|
|
|
|
|
|
|
|
</r></rant>
After 450 hours of work:
How I’m working now:
After 4 years working as an RSE
Understand and disseminate the differences.
Product | Chances to publish | Patches |
---|---|---|
Research paper | “one” | “embarrassing” |
Research software | “infinite” | good |
Publishing your code actually protects it!
Commit and push timestamps your work
Thank you for your attention!
Thank you for hosting us! ❤️ 🇫🇮