Skip to content
This repository has been archived by the owner on Jan 12, 2020. It is now read-only.

Loading multiple files at once #43

Open
markusruhsam opened this issue Sep 29, 2017 · 2 comments
Open

Loading multiple files at once #43

markusruhsam opened this issue Sep 29, 2017 · 2 comments

Comments

@markusruhsam
Copy link

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?

@sa-lee
Copy link
Owner

sa-lee commented Sep 30, 2017

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.

@tommydevitt
Copy link

When I try to use lapply I get

Error in read_lines_(ds, skip_empty_rows = skip_empty_rows, locale_ = locale, :
Cannot read file /results_f/k1: Invalid argument

Any suggestions?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants