Open markusruhsam opened 6 years ago
To load all the files at once you could use lapply on a vector of file names.
k6_all <- lapply(k6_files, loadStructure)
Q_all <- lapply(k6_all, getQ)
I agree that it would be good to add an option to just read the Q-matrix and ignore all other parts of the file though.
When I try to use lapply I get
Error in readlines(ds, skip_empty_rows = skip_emptyrows, locale = locale, : Cannot read file /results_f/k1: Invalid argument
Any suggestions?
Is it possible to load multiple STRUCTURE output files for the CLUMPPING together at once? At the moment it looks like that you have to load each output file separately k6_msat <- loadStructure(k6_file),.... and combine them with k6_all <- structList(k6_msat, k6_run2) which can then be used to Q_list <- lapply(k6_all, getQ). It would be much easier if it was possible to load for example all 10 repeat files of a certain K at once with something like allfiles <- choose.files() and then Q_list <- lapply(allfiles, getQ). Or is that possible already?