I want to generate 100 random integers from an exponential distribution in R, where each integer is between 10 and 50 (hence 10, 11, 12, ..., 49, 50). How can I do this in R?
You know the quantiles to which $10$ and $50$ correspond, right? These are given by
pexp(10, rate) and
pexp(50, rate), respectively. With a
rate of $1$, I get quantiles of $0.9999546$ and $\sim 1$, so you want exponential values between those quantiles.
Simulate from a uniform distribution with those values as the endpoints:
values <- runif(N, pexp(10, rate), pexp(50, rate)). These will be the exponential quantiles of your simulated data.
Now pass those quantiles through the exponential quantile function:
x <- qexp(values, rate) to look up their values.
This should generate exponential-y data that are limited to your range.
As has been noted, however, if you limit your range like this, you no longer have exponential data.
Round as Henry describes if you are determined to have integers.