> x<-getfile()> x$files[1] "/Users/nickwong/Library/R/3.1/library/poppr/files/test.csv"
$path[1] "/Users/nickwong/Library/R/3.1/library/poppr/files"
> myData<-read.genalex(x$files, ploidy = 2, geo = FALSE, region = FALSE)Error in if (any(gena.mat == "0") & ploidy < 3) { : missing value where TRUE/FALSE needed
> traceback()1: read.genalex(x$files, ploidy = 2, geo = FALSE, region = FALSE)> sessionInfo()R version 3.2.1 (2015-06-18)Platform: x86_64-apple-darwin13.4.0 (64-bit)Running under: OS X 10.10.4 (Yosemite)
locale:[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:[1] stats graphics grDevices utils datasets methods base
other attached packages:[1] poppr_2.0.2 adegenet_2.0.0 ade4_1.7-2
loaded via a namespace (and not attached): [1] Rcpp_0.12.0 spdep_0.5-88 plyr_1.8.3 pegas_0.8-1 [5] LearnBayes_2.15 tools_3.2.1 boot_1.3-16 digest_0.6.8 [9] nlme_3.1-120 gtable_0.1.2 lattice_0.20-31 mgcv_1.8-6 [13] Matrix_1.2-1 igraph_1.0.1 shiny_0.12.2 DBI_0.3.1 [17] parallel_3.2.1 proto_0.3-10 coda_0.17-1 cluster_2.0.1 [21] dplyr_0.4.2 stringr_1.0.0 grid_3.2.1 R6_2.1.0 [25] phangorn_1.99.14 sp_1.1-1 ggplot2_1.0.1 reshape2_1.4.1 [29] seqinr_3.1-3 deldir_0.1-9 magrittr_1.5 nnls_1.4 [33] scales_0.2.5 htmltools_0.2.6 MASS_7.3-40 splines_3.2.1 [37] assertthat_0.1 permute_0.8-4 mime_0.3 ape_3.3 [41] colorspace_1.2-6 xtable_1.7-4 httpuv_1.3.3 quadprog_1.5-5 [45] stringi_0.5-5 munsell_0.4.2 vegan_2.3-0 Hi Nick,
Thank you for your email and thank you for supplying the necessary diagnostic information. I believe you've discovered an edge case. I have tried it on some random data using the same entries and have run into an error as well (although not the same error). I will investigate this when I get in next week. Since you have one locus, I would suggest removing the first two rows of your spreadsheet and collapsing the last two columns into a single column (separating the alleles with "/") and importing that using read.table and then using df2genind like so:
my_df <- read.table("myData.csv", sep = ",", header = TRUE)
my_data <- df2genind(my_df[-c(1, 2), , drop = FALSE], ind.names = my_df$ind, pop.names = my_df$pop, ploidy = TRUE, sep = "/")Additionally:
[1] "/Users/nickwong/Library/R/3.1/library/poppr/files/test.csv"
This is from your output. You should not be saving files in your R library. This is a space only for packages. The example using getfile was simply an example using files that I could ship with poppr.
> myData<-read.genalex(x$files, ploidy = 2, geo = FALSE, region = FALSE)
Error in if (any(gena.mat == "0") & ploidy < 3) { :
missing value where TRUE/FALSE needed
> traceback()
1: read.genalex(x$files, ploidy = 2, geo = FALSE, region = FALSE)
--
You received this message because you are subscribed to the Google Groups "poppr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to poppr+un...@googlegroups.com.
To post to this group, send email to po...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/d76fa309-b5bf-41a0-a98f-64f1ea6c2be5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.