[R] random text added to names (bug with 2.10.0?)
Peter Dalgaard
P.Dalgaard at biostat.ku.dk
Fri Nov 6 16:45:11 CET 2009
Johann Hibschman wrote:
> I'm using 2.10.0 on Linux (64 bit), and I just noticed that random
> numbers are occasionally added to the text of names in vectors. It's
> happened to me in two separate, long-running R sessions, but I can't
> find a way to reproduce it in a smaller setting.
>
> The code I'm using is
>
>> diag.gam.2 <- mdl.run.diag(fit.gam.2, ds.valid)
>> diag.gam.2
> rmse mdae.1413751 mnae cv r2
> 0.023171639 0.007206221 0.012374469 1.259498479 0.385234756
>> mdl.run.diag
> function (fit, ds) {
> run.diagnostics(mdl.run(fit, ds))
> }
>> run.diagnostics
> function (ds) {
> c(rmse=root.mean.squared.error(ds),
> mdae=median.absolute.error(ds),
> mnae=mean.absolute.error(ds),
> cv=coefficient.of.variation(ds),
> r2=coefficient.of.determination(ds))
> }
>
> The problem is that extra ".1413751" that's mysteriously being added
> to the mdae name.
>
> Am I doing something obviously wrong, or is this a bug? I still have
> the two sessions running, if there are any diagnostics would help.
Definitely a bug. Presumably memory corruption somewhere.
Is it persistent? I.e., if you do the run.diagnostics() bit again, do
you get the same corrupted name? If so, I would suspect that something
is changing the function itself (which you cannot see unless you clear
its "source" attribute).
We do say "minimal, reproducible" code, but if push comes to shove,
"reproducible" is the important bit. If you can replicate the issue and
run the code under valgrind (the gory details of doing that are in
Writing R Extensions) then you could post back its messages, and to
those in the know, it might point the finger at the guilty code.
--
O__ ---- Peter Dalgaard Øster Farimagsgade 5, Entr.B
c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-help
mailing list