With the development of next-generation sequencing and genotyping approaches, large single nucleotide polymorphism haplotype datasets are becoming available in a growing number of both model and non-model species. Identifying genomic regions with unexpectedly high local haplotype homozygosity relatively to neutral expectation represents a powerful strategy to ascertain candidate genes responding to natural or artificial selection. To facilitate genome-wide scans of selection based on the analysis of long-range haplotypes, we developed the R package rehh. It provides a versatile tool to detect the footprints of recent or ongoing selection with several graphical functions that help visual interpretation of the results.