I've lost an entire day of work trying to do this operation which look very simple but apparently isn't that easy :
I have a dataframe with the first column as my population column, the other columns are loci and each row is an individual : (this is the format used by hierFstat by the way)
I would like to convert this data frame to a .txt file usable by the genepop package and I can't manage to find a solution that fit what I would like to do and it seems I'm not able to write such a function myself.
Anyone ever had to do such an operation ? and know a way ?
Thanks for your time !
(Sorry I'm new to the forum I hope I'm clear and correct)
I guess
write.table()
is the function you are looking for. Just have a look at the R documentation via?write.table
. Should look like this:You could also create a csv file and later on save it as a txt file (for example via Excel). Therefore you could use
write.csv()
orwrite.csv2()
. Please have a look at the corresponding R documentation, or simply google the functions.Is there a specific reason why you want to use a function of a specific package?