jgx65 / hierfstat

the hierfstat package
24 stars 14 forks source link

write.struct documentation #46

Closed plantarum closed 3 years ago

plantarum commented 3 years ago

Hi,

I found two issues that I think ought to be documented in the write.struct manual.

The ilab argument is described as: "ilab: whether to add a column with individual labels".

This suggests you expect a TRUE/FALSE value. However, you actually require a vector of individual labels. This could be clarified in the documentation? Or maybe you could use row.names(dat) by default, when ilab == TRUE?

Also, as I was sorting through the previous issue, I discovered that running write.struct repeatedly appends data to an existing file, rather than over-writing it. This is surprising I think? Maybe it would be good to check for the existence of the output file before adding to it, and issue a warning? That would be in line with what I see in other packages.

If you agree with either of these I can prepare a pull request.

jgx65 commented 3 years ago

Should be fixed now. Could you try it and close the issue if you are happy with the result?

plantarum commented 3 years ago

Thanks for the thorough response! I just checked and the output file is over-written rather than appended as expected. The revised documentation is clear.

Thanks!