I have a function
g(h) = 2h for -20 <= h <= 20 and 1 otherwise.
How can I plot this using R?
Very new to R so thanks for any guidance