The short answer

Your keyboard inherited QWERTY from early typewriters. The letters shifted as the machines evolved. Some arrangements gave the printing arms fewer chances to jam. The surviving records show where R ended up and leave the reason for that move open. As more people learned QWERTY, keeping it meant their typing skills carried over to new machines.12345

There used to be a period where R is

QWERTY takes its name from the first six letters in the top letter row of the familiar English-language keyboard. One of Christopher Latham Sholes’s earliest typewriters had two rows of piano-like keys arranged alphabetically. As Sholes and his collaborators revised the machine, they rearranged the keys, too.23

An 1872 engraving in Scientific American catches the keyboard mid-change. The top letter row starts with Q, W and E, then a period, then T and Y. R is down on the bottom row. By the time Remington released the Sholes and Glidden typewriter in 1874, R had moved into the period’s old spot. Sholes’s 1878 patent drawing shows the same six letters you can find on your keyboard today.123

What could jam under the keys?

On these typewriters, pressing a key sends a metal arm called a typebar swinging up. The raised character at its tip pushes an inked ribbon against the paper. All the arms aim for the same spot, so a second arm can catch the first before it swings back. One way to reduce the risk is to give letters you often type together arms that sit farther apart.24

The keys and the arms follow different orders. In economist Neil Kay’s reconstruction of an early Sholes and Glidden machine, E and R sit side by side on the keyboard. Inside, the arm for the number five sits between them. Using Mark Twain’s Life on the Mississippi, Kay counted how often successive letters would call on neighboring arms. He found fewer chances for a collision with the early QWERTY layout than with an alphabetical layout on the same mechanism.4

So why did R move? The patent shows the new position and explains the machinery. It leaves the reason for that move open. Researchers Koichi and Motoko Yasuoka also trace changes to requests from telegraph users. One early customer asked for number keys so he could type numbers arriving in Morse code. Avoiding jams was a problem the designers had to solve, alongside the demands of the people using the machines. The records leave room for both to have shaped the layout.234

Why did the letters stay there?

Once people learned to type by touch, they could sit down at another QWERTY machine and use the same finger movements. Economist Paul David described how that skill reinforced the layout. Employers had a reason to buy machines their typists already knew, and anyone learning to type had a reason to practice on the machines employers used.5

The layout traveled from typewriters to computers through equipment such as Teletype machines used as terminals. Computers kept the familiar letters after the metal arms were gone. Find R without looking and you’re using the same sort of learned habit that helped keep it there.35