Saving output from mlg.id

22 views
Skip to first unread message

Dallas

unread,
Nov 12, 2021, 9:17:46 AM11/12/21
to poppr
Hi there!

I'm trying to write the output from mlg.id(snpclone) to a .csv file, so I can look at it in excel, but I keep getting an error saying the number of rows don't match (see below). Does anyone know how I might be able to save the output from this function?

Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, : arguments imply differing number of rows: 1, 2, 3, 4, 5, 26, 25

Thanks!
Dallas

Zhian Kamvar

unread,
Nov 23, 2021, 6:43:39 PM11/23/21
to Dallas, poppr
Hello,

The problem is that the output of mlg.id() is a ragged list, which can not be transformed into a data frame because each column would have different numbers of rows.

What you _could_ do is use the list2DF() function to convert the output into a data frame and then write that data frame to a CSV. Just be aware that there will be duplicated entries in the majority of the columns with this route.

All the best,
Zhian
Reply all
Reply to author
Forward
0 new messages