Hello!
I have a genlight object with 80 genotypes and 3,575 SNPs. I successfully used gl.keep.loci to make a new genlight object with only 305 of the loci with the following code:
RAD_305 <- gl.keep.loc(RADgenlight, loc.list=c(x))
x is a list of the 305 loci.
I would now like to remove individuals from RAD_305. Here is the code I'm using:
RAD_305 <- gl.drop.ind(RAD_305, ind.list = c('004','LZ19','LZ79','LZD9','MZ29','MZ99','MZQ9','NZE9','NZF9','UZZJ','VZ7J','WZ1J'))
But I receive this error:
Error in `$<-.data.frame`(`*tmp*`, "AvgPIC", value = c(NA, NA, NA, NA, :
replacement has 305 rows, data has 1
I've tried using gl.keep.ind with the list of samples I want to keep, but I get the same error as the one above. I've confirmed that all the samples are present in RAD_305.
Session info:
R version 4.2.3 (2023-03-15)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Ventura 13.2.1
dartR_2.7.2
Thank you!