Running examples in ‘dartR.popgen-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: gl.ld.haplotype
> ### Title: Visualize patterns of linkage disequilibrium and identification
> ###   of haplotypes
> ### Aliases: gl.ld.haplotype
> 
> ### ** Examples
> 
> require("dartR.data")
> x <- platypus.gl
> x <- gl.filter.callrate(x, threshold = 1)
Starting gl.filter.callrate 
  Processing genlight object with SNP data
  Warning: data include loci that are scored NA across all individuals.
  Consider filtering using gl <- gl.filter.allna(gl)
  Warning: Data may include monomorphic loci in call rate 
                    calculations for filtering
  Recalculating Call Rate
  Removing loci based on Call Rate, threshold = 1 
Completed: gl.filter.callrate 
> # only the first 15 individuals because of speed during tests
> x <- gl.keep.pop(x, pop.list = "TENTERFIELD")[1:15, ]
Starting gl.keep.pop 
  Processing genlight object with SNP data
  Checking for presence of nominated populations
  Retaining only populations TENTERFIELD 
  Warning: Resultant dataset may contain monomorphic loci
  Locus metrics not recalculated
Completed: gl.keep.pop 
> x$chromosome <- as.factor(x$other$loc.metrics$Chrom_Platypus_Chrom_NCBIv1)
> x$position <- x$other$loc.metrics$ChromPos_Platypus_Chrom_NCBIv1
> ld_res <- gl.ld.haplotype(x,
+   chrom_name = "NC_041728.1_chromosome_1",
+   ld_max_pairwise = 10000000
+ )
Starting gl.ld.haplotype 
  Processing genlight object with SNP data
  Calculating pairwise LD in population TENTERFIELD 
  Analysing chromosome NC_041728.1_chromosome_1 
  The maximum distance at which LD should be calculated
                 (ld_max_pairwise) is too short for chromosome NC_041728.1_chromosome_1 . Setting this distance to 40201976 bp
Error in loadNamespace(x) : there is no package called ‘raster’
Calls: gl.ld.haplotype ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Examples with CPU (user + system) or elapsed time > 5s
                user system elapsed
gl.ld.distance 5.299   0.11   6.747