Keep R running while screen is off in Big Sur (11.0.1)
The fastest way to always stop sleep is the built-in Terminal command caffeinate which will let you set various options on preventing sleep.
Another way is to disable sleep when plugged into battery under Settings, which is likely the easiest method as it has a visual indicator by way of the charger.
The Amphetamine app is yet another method, and it has a friendlier UI compared to Terminal as well as extra options.
By default all apps sleep when the display is off unless the app specifically requests otherwise.