How can I assign a genomic region into a window using R?
I'm not sure how you did your calculation but for me it looks like your region is 3499713 bp in length.

site &lt;- GRanges("chr1:6199548-9699260")

seqlength &lt;- c(chr1=159217232,chr2=184765313,chr3=182121094,chr4=221926752,chr5=187413619)

bin_length &lt;- width(site)

## check length of region
print(bin_length)
##3499713

bins &lt;- tileGenome(seqlength, tilewidth=bin_length, cut.last.tile.in.chrom=TRUE)

## extract overlapping bins
flank.bins &lt;- subsetByOverlaps(bins,site)

## find new coordinates excluding region of interest
new.flank.bins &lt;- setdiff(reduce(flank.bins),site)

## combine new bins with your region of interest
new.bins &lt;- c(new.flank.bins,site)

## remove old bins
bins &lt;- subsetByOverlaps(bins,new.bins,invert=T)

## add new bins
bins &lt;- sort(c(bins,new.bins))

## check that it makes sense
##table(width(bins[seqnames(bins) == 'chr1']))

write.table(bins,file=paste("bins_good_",bin_length,sep=""),col.names= FALSE, row.names = TRUE)