Chubing - 9 months ago 72

R Question

I want to plot an exponential distribution, something like this for example:

But I only know how to simulate a data frame that follow a exponential distribution and plot it.

`data = data.frame(x=rexp(n = 100000, rate = .65))`

m <- ggplot(data, aes(x=data$x))

m + geom_density()

From which I get:

How can I plot the true exponential distribution instead of a sampled version of the distribution?

Answer Source