Error during gl.LNDe

10 views
Skip to first unread message

Yayan Kusuma

unread,
Oct 15, 2025, 4:46:14 AMOct 15
to dartR
Dear all,

I am having a little problem running gl.LNde. I tried to run the training module from https://green-striped-gecko.github.io/kioloa/session05.html.

Using the code provided by the module the code give me the error results as follow:

Error in `levels<-`(`*tmp*`, value = as.character(levels)) : factor level [2] is duplicated

Another case is that the outfile is saved in a folder other than the path I set up (setwd) in my session, which is in the temp folder.

I run the code exactly as the module with a minor change on the Ne estimator path.

pops <- possums.gl[1:60, 1:100]
nes <- gl.LDNe(pops,  outfile = "popsLD.txt", neest.path = "./Ne/",
               critical = c(0, 0.05), singleton.rm = TRUE, mating = "random")

What would be the mistake here?

Thank you for the help.

Sincerely yours,
YK

Yayan Kusuma

unread,
Oct 21, 2025, 11:46:25 PM (14 days ago) Oct 21
to dartR
Dear all,

I tried my own dataset for this code and updated the latest package, but the error messages still exist. I run them on R. 4.4.1.
Any help with this?

Thank you in advance.

Best,
YK

Bernd.Gruber

unread,
Oct 22, 2025, 5:54:59 PM (13 days ago) Oct 22
to da...@googlegroups.com

Hi Yayan,

 

Sounds like your names (or loci) have duplicated names and that throws of the function.

 

Can you try:

 

indNames(gl) <-  make.unique(indNames(gl))  #add .1 etc to duplicates

 

and potentially also

 

locNames(gl) <- make.unique(locNames(gl))

 

 

That might work.

 

Cheers, Bernd

--
You received this message because you are subscribed to the Google Groups "dartR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dartr+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dartr/eeaa45e1-8f5a-4c20-9d7d-0f7837ee81afn%40googlegroups.com.

Yayan Kusuma

unread,
Oct 22, 2025, 11:52:56 PM (13 days ago) Oct 22
to da...@googlegroups.com

Dear Bernd,

Yes, that's me. 

Thanks for the solution to try but unfortunatelly I still get the same error. The results were found as files in the temp folder but unsaved in the R studio as before. The full code and error results are as follows:

# SNP data (use two populations and only the first 100 SNPs)

pops <- possums.gl[1:60, 1:100]

indNames(pops) <-  make.unique(indNames(pops))  #add .1 etc to duplicates

#and potentially also
locNames(pops) <- make.unique(locNames(pops))

nes <- gl.LDNe(pops,  outfile = "popsLD.txt", neest.path = "./Ne/",
               critical = c(0, 0.05), singleton.rm = TRUE, mating = "random")

> nes <- gl.LDNe(pops,  outfile = "popsLD.txt", neest.path = "./Ne/",
+                critical = c(0, 0.05), singleton.rm = TRUE, mating = "random")
Starting gl.LDNe 
  Processing genlight object with SNP data
Starting gl2genepop 
  Processing genlight object with SNP data
  The genepop file is saved as:  C:\Users\YAYANK~1\AppData\Local\Temp\RtmpQNzEH6/dummy.gen/
Completed: gl2genepop 
Number of loci = 100, 2-digit alleles
Input file: dummy.gen - GENEPOP format
Number of loci = 100, 2-digit alleles
Method(s): LD
Locus names - last 6 characters:
X1     X2     X3     X4     X5     X6     X7     X8     X9     X10    
X11    X12    X13    X14    X15    X16    X17    X18    X19    X20    
X21    X22    X23    X24    X25    X26    X27    X28    X29    X30    
X31    X32    X33    X34    X35    X36    X37    X38    X39    X40    
X41    X42    X43    X44    X45    X46    X47    X48    X49    X50    
X51    X52    X53    X54    X55    X56    X57    X58    X59    X60    
X61    X62    X63    X64    X65    X66    X67    X68    X69    X70    
X71    X72    X73    X74    X75    X76    X77    X78    X79    X80    
X81    X82    X83    X84    X85    X86    X87    X88    X89    X90    
X91    X92    X93    X94    X95    X96    X97    X98    X99    X100   
Outputs are written to file popsLD.txt
Tabular-format LD Output File Name: popsLDxLD.txt
Starting time: Thu Oct 23 10:44:53 2025

Population     1 [A_1]
-> Total samples = 30
   Allele frequencies are being written to file dummyLoc.txt.
   * For lowest freq: 0.050
       Estimate of Ne:                 14.3
     Parameter CI:            12.1            16.9
     Jackknife CI:             8.6            24.7
   * For lowest freq:    0+
       Estimate of Ne:                 15.9
     Parameter CI:            13.6            18.7
     Jackknife CI:            10.4            25.6
   * For lowest freq: 0.000
       Estimate of Ne:                 15.1
     Parameter CI:            12.9            17.7
     Jackknife CI:             9.8            24.1
   * For lowest freq:    0+
       Estimate of Ne:                 15.9
     Parameter CI:            13.6            18.7
     Jackknife CI:            10.4            25.6

Population     2 [B_31]
-> Total samples = 30
   Allele frequencies are being written to file dummyLoc.txt.
   * For lowest freq: 0.050
       Estimate of Ne:                 17.1
     Parameter CI:            14.7            19.9
     Jackknife CI:            11.5            26.5
   * For lowest freq:    0+
       Estimate of Ne:                 18.5
     Parameter CI:            16.0            21.6
     Jackknife CI:            12.3            29.6
   * For lowest freq: 0.000
       Estimate of Ne:                 17.1
     Parameter CI:            14.7            19.9
     Jackknife CI:            11.5            26.5
   * For lowest freq:    0+
       Estimate of Ne:                 18.5
     Parameter CI:            16.0            21.6
     Jackknife CI:            12.3            29.6
Error in `levels<-`(`*tmp*`, value = as.character(levels)) : 
  factor level [2] is duplicated
It sounds a simple error but I couldn't figure it out why and how to solve it.

Best,
YK




R version 4.4.1 (2024-06-14 ucrt) -- "Race for Your Life"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Workspace loaded from D:/my.R.project/Cinereus/.RData]

Loading required package: adegenet
Loading required package: ade4
Loading required package: adegenet
Loading required package: ade4

   /// adegenet 2.1.11 is loaded ////////////

   > overview: '?adegenet'
   > tutorials/doc/questions: 'adegenetWeb()' 
   > bug reports/feature requests: adegenetIssues()


Loading required package: vcfR

   *****       ***   vcfR   ***       *****
   This is vcfR 1.15.0 
     browseVignettes('vcfR') # Documentation
     citation('vcfR') # Citation
   *****       *****      *****       *****

Registered S3 method overwritten by 'pegas':
  method      from
  print.amova ade4
Registered S3 method overwritten by 'genetics':
  method      from 
  [.haplotype pegas
> library(dartRverse)
**********************************************
**** Welcome to dartRverse [Version 1.0.6] ****
**********************************************
── Core dartRverse packages ──────────────────────────────────────────────────────────────── dartRverse ──
 dartR.base 1.0.7      dartR.data 1.0.8
── Installed dartRverse packages   ───────────────────────────────────────────────────────── dartRverse ──
 dartR.popgen  1.0.5      dartR.spatial 0.92 
 dartR.sim     0.70      
── Not [yet] installed dartRverse packages ───────────────────────────────────────────────── dartRverse ──
 dartR.captive         dartR.sexlinked 
Warning messages:
1: package ‘adegenet’ was built under R version 4.4.3 
2: package ‘ade4’ was built under R version 4.4.3 
3: package ‘dartRverse’ was built under R version 4.4.3 
> library(dartR.popgen)
> library(ggplot2)
> library(devtools)
Loading required package: usethis
Warning message:
package ‘usethis’ was built under R version 4.4.3 
> library(geohippos)
Loading required package: parallel
Loading required package: furrr
Loading required package: future

Attaching package: ‘geohippos’

The following object is masked from ‘package:dartR.base’:

    gl.read.vcf

Warning message:
package ‘future’ was built under R version 4.4.3 
> # Run as it was classically run
> # SNP data (use two populations and only the first 100 SNPs)
> pops <- possums.gl[1:60, 1:100]
> nes <- gl.LDNe(pops,  outfile = "popsLD.txt", neest.path = "./Ne/",
+                critical = c(0, 0.05), singleton.rm = TRUE, mating = "random")
Starting gl.LDNe 
  Processing genlight object with SNP data
Starting gl2genepop 
  Processing genlight object with SNP data
  The genepop file is saved as:  C:\Users\YAYANK~1\AppData\Local\Temp\RtmpQNzEH6/dummy.gen/
Completed: gl2genepop 
Number of loci = 100, 2-digit alleles
Input file: dummy.gen - GENEPOP format
Number of loci = 100, 2-digit alleles
Method(s): LD
Locus names - last 6 characters:
X1     X2     X3     X4     X5     X6     X7     X8     X9     X10    
X11    X12    X13    X14    X15    X16    X17    X18    X19    X20    
X21    X22    X23    X24    X25    X26    X27    X28    X29    X30    
X31    X32    X33    X34    X35    X36    X37    X38    X39    X40    
X41    X42    X43    X44    X45    X46    X47    X48    X49    X50    
X51    X52    X53    X54    X55    X56    X57    X58    X59    X60    
X61    X62    X63    X64    X65    X66    X67    X68    X69    X70    
X71    X72    X73    X74    X75    X76    X77    X78    X79    X80    
X81    X82    X83    X84    X85    X86    X87    X88    X89    X90    
X91    X92    X93    X94    X95    X96    X97    X98    X99    X100   
Outputs are written to file popsLD.txt
Tabular-format LD Output File Name: popsLDxLD.txt
Starting time: Thu Oct 23 10:34:17 2025

Population     1 [A_1]
-> Total samples = 30
   Allele frequencies are being written to file dummyLoc.txt.
   * For lowest freq: 0.050
       Estimate of Ne:                 14.3
     Parameter CI:            12.1            16.9
     Jackknife CI:             8.6            24.7
   * For lowest freq:    0+
       Estimate of Ne:                 15.9
     Parameter CI:            13.6            18.7
     Jackknife CI:            10.4            25.6
   * For lowest freq: 0.000
       Estimate of Ne:                 15.1
     Parameter CI:            12.9            17.7
     Jackknife CI:             9.8            24.1
   * For lowest freq:    0+
       Estimate of Ne:                 15.9
     Parameter CI:            13.6            18.7
     Jackknife CI:            10.4            25.6

Population     2 [B_31]
-> Total samples = 30
   Allele frequencies are being written to file dummyLoc.txt.
   * For lowest freq: 0.050
       Estimate of Ne:                 17.1
     Parameter CI:            14.7            19.9
     Jackknife CI:            11.5            26.5
   * For lowest freq:    0+
       Estimate of Ne:                 18.5
     Parameter CI:            16.0            21.6
     Jackknife CI:            12.3            29.6
   * For lowest freq: 0.000
       Estimate of Ne:                 17.1
     Parameter CI:            14.7            19.9
     Jackknife CI:            11.5            26.5
   * For lowest freq:    0+
       Estimate of Ne:                 18.5
     Parameter CI:            16.0            21.6
     Jackknife CI:            12.3            29.6
Error in `levels<-`(`*tmp*`, value = as.character(levels)) : 
  factor level [2] is duplicated
> # Error in `levels<-`(`*tmp*`, value = as.character(levels)) : factor level [2] is duplicated
> # emerge
> indNames(pops) <-  make.unique(indNames(pops))  #add .1 etc to duplicates
> nes <- gl.LDNe(pops,  outfile = "popsLD.txt", neest.path = "./Ne/",
+                critical = c(0, 0.05), singleton.rm = TRUE, mating = "random")
Starting gl.LDNe 
  Processing genlight object with SNP data
Starting gl2genepop 
  Processing genlight object with SNP data
  The genepop file is saved as:  C:\Users\YAYANK~1\AppData\Local\Temp\RtmpQNzEH6/dummy.gen/
Completed: gl2genepop 
Number of loci = 100, 2-digit alleles
Input file: dummy.gen - GENEPOP format
Number of loci = 100, 2-digit alleles
Method(s): LD
Locus names - last 6 characters:
X1     X2     X3     X4     X5     X6     X7     X8     X9     X10    
X11    X12    X13    X14    X15    X16    X17    X18    X19    X20    
X21    X22    X23    X24    X25    X26    X27    X28    X29    X30    
X31    X32    X33    X34    X35    X36    X37    X38    X39    X40    
X41    X42    X43    X44    X45    X46    X47    X48    X49    X50    
X51    X52    X53    X54    X55    X56    X57    X58    X59    X60    
X61    X62    X63    X64    X65    X66    X67    X68    X69    X70    
X71    X72    X73    X74    X75    X76    X77    X78    X79    X80    
X81    X82    X83    X84    X85    X86    X87    X88    X89    X90    
X91    X92    X93    X94    X95    X96    X97    X98    X99    X100   
Outputs are written to file popsLD.txt
Tabular-format LD Output File Name: popsLDxLD.txt
Starting time: Thu Oct 23 10:35:26 2025

Population     1 [A_1]
-> Total samples = 30
   Allele frequencies are being written to file dummyLoc.txt.
   * For lowest freq: 0.050
       Estimate of Ne:                 14.3
     Parameter CI:            12.1            16.9
     Jackknife CI:             8.6            24.7
   * For lowest freq:    0+
       Estimate of Ne:                 15.9
     Parameter CI:            13.6            18.7
     Jackknife CI:            10.4            25.6
   * For lowest freq: 0.000
       Estimate of Ne:                 15.1
     Parameter CI:            12.9            17.7
     Jackknife CI:             9.8            24.1
   * For lowest freq:    0+
       Estimate of Ne:                 15.9
     Parameter CI:            13.6            18.7
     Jackknife CI:            10.4            25.6

Population     2 [B_31]
-> Total samples = 30
   Allele frequencies are being written to file dummyLoc.txt.
   * For lowest freq: 0.050
       Estimate of Ne:                 17.1
     Parameter CI:            14.7            19.9
     Jackknife CI:            11.5            26.5
   * For lowest freq:    0+
       Estimate of Ne:                 18.5
     Parameter CI:            16.0            21.6
     Jackknife CI:            12.3            29.6
   * For lowest freq: 0.000
       Estimate of Ne:                 17.1
     Parameter CI:            14.7            19.9
     Jackknife CI:            11.5            26.5
   * For lowest freq:    0+
       Estimate of Ne:                 18.5
     Parameter CI:            16.0            21.6
     Jackknife CI:            12.3            29.6
Error in `levels<-`(`*tmp*`, value = as.character(levels)) : 
  factor level [2] is duplicated
> #and potentially also
> locNames(pops) <- make.unique(locNames(pops))
> nes <- gl.LDNe(pops,  outfile = "popsLD.txt", neest.path = "./Ne/",
+                critical = c(0, 0.05), singleton.rm = TRUE, mating = "random")
Starting gl.LDNe 
  Processing genlight object with SNP data
Starting gl2genepop 
  Processing genlight object with SNP data
  The genepop file is saved as:  C:\Users\YAYANK~1\AppData\Local\Temp\RtmpQNzEH6/dummy.gen/
Completed: gl2genepop 
Number of loci = 100, 2-digit alleles
Input file: dummy.gen - GENEPOP format
Number of loci = 100, 2-digit alleles
Method(s): LD
Locus names - last 6 characters:
X1     X2     X3     X4     X5     X6     X7     X8     X9     X10    
X11    X12    X13    X14    X15    X16    X17    X18    X19    X20    
X21    X22    X23    X24    X25    X26    X27    X28    X29    X30    
X31    X32    X33    X34    X35    X36    X37    X38    X39    X40    
X41    X42    X43    X44    X45    X46    X47    X48    X49    X50    
X51    X52    X53    X54    X55    X56    X57    X58    X59    X60    
X61    X62    X63    X64    X65    X66    X67    X68    X69    X70    
X71    X72    X73    X74    X75    X76    X77    X78    X79    X80    
X81    X82    X83    X84    X85    X86    X87    X88    X89    X90    
X91    X92    X93    X94    X95    X96    X97    X98    X99    X100   
Outputs are written to file popsLD.txt
Tabular-format LD Output File Name: popsLDxLD.txt
Starting time: Thu Oct 23 10:35:35 2025

Population     1 [A_1]
-> Total samples = 30
   Allele frequencies are being written to file dummyLoc.txt.
   * For lowest freq: 0.050
       Estimate of Ne:                 14.3
     Parameter CI:            12.1            16.9
     Jackknife CI:             8.6            24.7
   * For lowest freq:    0+
       Estimate of Ne:                 15.9
     Parameter CI:            13.6            18.7
     Jackknife CI:            10.4            25.6
   * For lowest freq: 0.000
       Estimate of Ne:                 15.1
     Parameter CI:            12.9            17.7
     Jackknife CI:             9.8            24.1
   * For lowest freq:    0+
       Estimate of Ne:                 15.9
     Parameter CI:            13.6            18.7
     Jackknife CI:            10.4            25.6

Population     2 [B_31]
-> Total samples = 30
   Allele frequencies are being written to file dummyLoc.txt.
   * For lowest freq: 0.050
       Estimate of Ne:                 17.1
     Parameter CI:            14.7            19.9
     Jackknife CI:            11.5            26.5
   * For lowest freq:    0+
       Estimate of Ne:                 18.5
     Parameter CI:            16.0            21.6
     Jackknife CI:            12.3            29.6
   * For lowest freq: 0.000
       Estimate of Ne:                 17.1
     Parameter CI:            14.7            19.9
     Jackknife CI:            11.5            26.5
   * For lowest freq:    0+
       Estimate of Ne:                 18.5
     Parameter CI:            16.0            21.6
     Jackknife CI:            12.3            29.6
Error in `levels<-`(`*tmp*`, value = as.character(levels)) : 
  factor level [2] is duplicated
> pops@pop
 [1] A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A B B B B B B B B B B B B B B B B B B B B B
[52] B B B B B B B B B
Levels: A B
> indNames(pops)
 [1] "1"  "2"  "3"  "4"  "5"  "6"  "7"  "8"  "9"  "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "20"
[21] "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "40"
[41] "41" "42" "43" "44" "45" "46" "47" "48" "49" "50" "51" "52" "53" "54" "55" "56" "57" "58" "59" "60"
> locNames(pops)
  [1] "X1"   "X2"   "X3"   "X4"   "X5"   "X6"   "X7"   "X8"   "X9"   "X10"  "X11"  "X12"  "X13"  "X14" 
 [15] "X15"  "X16"  "X17"  "X18"  "X19"  "X20"  "X21"  "X22"  "X23"  "X24"  "X25"  "X26"  "X27"  "X28" 
 [29] "X29"  "X30"  "X31"  "X32"  "X33"  "X34"  "X35"  "X36"  "X37"  "X38"  "X39"  "X40"  "X41"  "X42" 
 [43] "X43"  "X44"  "X45"  "X46"  "X47"  "X48"  "X49"  "X50"  "X51"  "X52"  "X53"  "X54"  "X55"  "X56" 
 [57] "X57"  "X58"  "X59"  "X60"  "X61"  "X62"  "X63"  "X64"  "X65"  "X66"  "X67"  "X68"  "X69"  "X70" 
 [71] "X71"  "X72"  "X73"  "X74"  "X75"  "X76"  "X77"  "X78"  "X79"  "X80"  "X81"  "X82"  "X83"  "X84" 
 [85] "X85"  "X86"  "X87"  "X88"  "X89"  "X90"  "X91"  "X92"  "X93"  "X94"  "X95"  "X96"  "X97"  "X98" 
 [99] "X99"  "X100"
> pops
 /// GENLIGHT OBJECT /////////

 // 60 genotypes,  100 binary SNPs, size: 129.4 Kb
 0 (0 %) missing data

 // Basic content
   @gen: list of 60 SNPbin
   @ploidy: ploidy of each individual  (range: 2-2)

 // Optional content
   @ind.names:  60 individual labels
   @loc.names:  100 locus labels
   @pop: population of each individual (group size range: 30-30)
   @other: a list containing: xy  loc.metrics  loc.metrics.flags  verbose  history  latlon 

> # still doesn't work
> pop(pops) <-  make.unique(pop(pops))
Error in make.unique(pop(pops)) : 'names' must be a character vector
> # still doesn't work
> popNames(pops) <-  make.unique(popNames(pops))
> pops@pop
 [1] A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A B B B B B B B B B B B B B B B B B B B B B
[52] B B B B B B B B B
Levels: A B
> nes <- gl.LDNe(pops,  outfile = "popsLD.txt", neest.path = "./Ne/",
+                critical = c(0, 0.05), singleton.rm = TRUE, mating = "random")
Starting gl.LDNe 
  Processing genlight object with SNP data
Starting gl2genepop 
  Processing genlight object with SNP data
  The genepop file is saved as:  C:\Users\YAYANK~1\AppData\Local\Temp\RtmpQNzEH6/dummy.gen/
Completed: gl2genepop 
Number of loci = 100, 2-digit alleles
Input file: dummy.gen - GENEPOP format
Number of loci = 100, 2-digit alleles
Method(s): LD
Locus names - last 6 characters:
X1     X2     X3     X4     X5     X6     X7     X8     X9     X10    
X11    X12    X13    X14    X15    X16    X17    X18    X19    X20    
X21    X22    X23    X24    X25    X26    X27    X28    X29    X30    
X31    X32    X33    X34    X35    X36    X37    X38    X39    X40    
X41    X42    X43    X44    X45    X46    X47    X48    X49    X50    
X51    X52    X53    X54    X55    X56    X57    X58    X59    X60    
X61    X62    X63    X64    X65    X66    X67    X68    X69    X70    
X71    X72    X73    X74    X75    X76    X77    X78    X79    X80    
X81    X82    X83    X84    X85    X86    X87    X88    X89    X90    
X91    X92    X93    X94    X95    X96    X97    X98    X99    X100   
Outputs are written to file popsLD.txt
Tabular-format LD Output File Name: popsLDxLD.txt
Starting time: Thu Oct 23 10:38:24 2025

Population     1 [A_1]
-> Total samples = 30
   Allele frequencies are being written to file dummyLoc.txt.
   * For lowest freq: 0.050
       Estimate of Ne:                 14.3
     Parameter CI:            12.1            16.9
     Jackknife CI:             8.6            24.7
   * For lowest freq:    0+
       Estimate of Ne:                 15.9
     Parameter CI:            13.6            18.7
     Jackknife CI:            10.4            25.6
   * For lowest freq: 0.000
       Estimate of Ne:                 15.1
     Parameter CI:            12.9            17.7
     Jackknife CI:             9.8            24.1
   * For lowest freq:    0+
       Estimate of Ne:                 15.9
     Parameter CI:            13.6            18.7
     Jackknife CI:            10.4            25.6

Population     2 [B_31]
-> Total samples = 30
   Allele frequencies are being written to file dummyLoc.txt.
   * For lowest freq: 0.050
       Estimate of Ne:                 17.1
     Parameter CI:            14.7            19.9
     Jackknife CI:            11.5            26.5
   * For lowest freq:    0+
       Estimate of Ne:                 18.5
     Parameter CI:            16.0            21.6
     Jackknife CI:            12.3            29.6
   * For lowest freq: 0.000
       Estimate of Ne:                 17.1
     Parameter CI:            14.7            19.9
     Jackknife CI:            11.5            26.5
   * For lowest freq:    0+
       Estimate of Ne:                 18.5
     Parameter CI:            16.0            21.6
     Jackknife CI:            12.3            29.6
Error in `levels<-`(`*tmp*`, value = as.character(levels)) : 
  factor level [2] is duplicated
> pops
 /// GENLIGHT OBJECT /////////

 // 60 genotypes,  100 binary SNPs, size: 129.4 Kb
 0 (0 %) missing data

 // Basic content
   @gen: list of 60 SNPbin
   @ploidy: ploidy of each individual  (range: 2-2)

 // Optional content
   @ind.names:  60 individual labels
   @loc.names:  100 locus labels
   @pop: population of each individual (group size range: 30-30)
   @other: a list containing: xy  loc.metrics  loc.metrics.flags  verbose  history  latlon 

> # Run as it was classically run
> # SNP data (use two populations and only the first 100 SNPs)
> pops <- possums.gl[1:60, 1:100]
> pops
 /// GENLIGHT OBJECT /////////

 // 60 genotypes,  100 binary SNPs, size: 129.4 Kb
 0 (0 %) missing data

 // Basic content
   @gen: list of 60 SNPbin
   @ploidy: ploidy of each individual  (range: 2-2)

 // Optional content
   @ind.names:  60 individual labels
   @loc.names:  100 locus labels
   @pop: population of each individual (group size range: 30-30)
   @other: a list containing: xy  loc.metrics  loc.metrics.flags  verbose  history  latlon 

> po...@ind.names
 [1] "1"  "2"  "3"  "4"  "5"  "6"  "7"  "8"  "9"  "10" "11" "12" "13" "14" "15" "16" "17" "18" "19" "20"
[21] "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" "31" "32" "33" "34" "35" "36" "37" "38" "39" "40"
[41] "41" "42" "43" "44" "45" "46" "47" "48" "49" "50" "51" "52" "53" "54" "55" "56" "57" "58" "59" "60"
> po...@loc.names
  [1] "X1"   "X2"   "X3"   "X4"   "X5"   "X6"   "X7"   "X8"   "X9"   "X10"  "X11"  "X12"  "X13"  "X14" 
 [15] "X15"  "X16"  "X17"  "X18"  "X19"  "X20"  "X21"  "X22"  "X23"  "X24"  "X25"  "X26"  "X27"  "X28" 
 [29] "X29"  "X30"  "X31"  "X32"  "X33"  "X34"  "X35"  "X36"  "X37"  "X38"  "X39"  "X40"  "X41"  "X42" 
 [43] "X43"  "X44"  "X45"  "X46"  "X47"  "X48"  "X49"  "X50"  "X51"  "X52"  "X53"  "X54"  "X55"  "X56" 
 [57] "X57"  "X58"  "X59"  "X60"  "X61"  "X62"  "X63"  "X64"  "X65"  "X66"  "X67"  "X68"  "X69"  "X70" 
 [71] "X71"  "X72"  "X73"  "X74"  "X75"  "X76"  "X77"  "X78"  "X79"  "X80"  "X81"  "X82"  "X83"  "X84" 
 [85] "X85"  "X86"  "X87"  "X88"  "X89"  "X90"  "X91"  "X92"  "X93"  "X94"  "X95"  "X96"  "X97"  "X98" 
 [99] "X99"  "X100"
> pop(pops) <-  make.unique(pop(pops))
Error in make.unique(pop(pops)) : 'names' must be a character vector

You received this message because you are subscribed to a topic in the Google Groups "dartR" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dartr/2TecbYjEu1E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dartr+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/dartr/ME3PR01MB79441149D1EB17376C7B0794D4F3A%40ME3PR01MB7944.ausprd01.prod.outlook.com.

Bernd.Gruber

unread,
Oct 23, 2025, 12:12:20 AM (13 days ago) Oct 23
to da...@googlegroups.com, Luis Mijangos

Weird, your code runs here without any problem…

 

@Luis Mijangos: any ideas?

Reply all
Reply to author
Forward
0 new messages