P’s kind of a weird letter, as it seems to have changed form in each alphabet that preceded ours. Our Latin version of it comes from an Etruscan symbol that looks more like a backwards 1 (or possibly a 7). Latin took it from the Greek pi, and while these days we mostly know pi as the tiny, table-like Π or π, originally it taller and missing a leg, similar to the Etruscan version.
I’ve mentioned this before, but the Greeks were the first in Europe to create a full alphabet. They based their letters on the Phoenician consonantal alphabet, a cousin to Hebrew. The Phoenician P is more of a hook rather than the angular symbol Greek has, plus it’s also facing in the opposite direction. Why it changed so much is anyone’s guess.
Of course, the story doesn’t end (or begin, rather) there. Phoenician developed in around 1500 BCE, but it was created from an already existing consonantal alphabet called Proto-Sinaitic, which is probably the first of said alphabets to develop. If you look at the .gif again, you’ll see that the Proto Sinaitic symbol probably came from the Egyptian hieroglyph for finger, which is a symbol that again, looks nothing like what we know it as.
TL;DR: P’s form was changed around a lot. I guess no one liked how they wrote it. And PS: it isn’t related to the letter R at all.