library("Gviz")
gen <- "hg38"
chr <- "chr7"
start <- 38290160
end <- 38303219
if(interactive()) {
  snpUCSCtrack<-snpLocations_UCSC(gen,chr,start,end,"All SNPs(142)")
  plotTracks(snpUCSCtrack, from = start, to =end)
} else {
  data(snpUCSCtrack)
  plotTracks(snpUCSCtrack, from = start, to =end)
}
Run the code above in your browser using DataLab