The R button refers to the right shoulder button on the Wii U GamePad, the Nintendo 64, GameCube, Classic, and Wii U Pro Controllers, and on the Nintendo 3DS itself. Its purpose in Super Smash Bros. is to grab opponents. It is used in Melee and Brawl for defense techniques, such as shielding, rolling, air dodging in midair, and sidestep dodging, which is shared with the L button, while in Super Smash Bros. for Nintendo 3DS, it is used for shielding. In Ultimate, it also refers to one of the shoulder buttons of the Pro Controller or the double Joy-Cons (not to be confused with the SR button). By default, it has the same function as the L button, being used for grabbing and, while in the air, airdodging.
When using a single Joy-Con in Ultimate, the R or L button (depending on which Joy-Con is used) is not set to any action by default. Instead, SR is used for shielding and SL for grabbing. In this configuration, the L, R, ZL, and ZR buttons cannot be set to grab.