VincyaneBadouard / TreeData_broken

Harmonization and correction forest data tool.
https://vincyanebadouard.github.io/TreeData/
0 stars 1 forks source link

self referencing issues in correction functions #61

Closed ValentineHerr closed 1 year ago

ValentineHerr commented 1 year ago

I believe this line of code causes this warning:

Invalid .internal.selfref detected and fixed by taking a (shallow) copy of the data.table so that := can 
add this new column by reference. At an earlier point, this data.table has been copied by R 
(or was created manually using structure() or similar). Avoid names<- and attr<- which in R 
currently (and oddly) may copy the whole data.table. Use set* syntax instead to avoid copying: ?set, 
?setnames and ?setattr. If this message doesn't help, please report your use case to the data.table issue 
tracker so the root cause can be fixed or this message improved.

I believe @cpiponiot you had fixed this issue in some other functions. I'll try to fix this.

cpiponiot commented 1 year ago

Yes, I think that's the problem too, but I haven't found a good way to deal with it, so I just removed the warnings. I don't think it causes any big problems but I'm not sure. I think we could change the name of the DBHcor variable (to be different from the DataTree column) to avoid this problem.