# What is the correct to model inverse gamma distribution [closed]

I tried to use below R code to model inverse gamma distribution (alpha=1,beta=1). However, the resulting histogram is not alike the one plotted in the wiki. Could anyone provide any hint about this? Thank for you help.

v <- rgamma(1,1,100000) v <- 1 / v dv <- as.data.frame(v) ggplot(data=dv,aes(x=v)) + geom_histogram()

The line v <- rgamma(1,1,100000) draws one observation from a $\text{Gamma}(1,100000)$. You can't make a histogram of this, since you only have one point. Since you say you want to draw from an $\text{InvGamma}(1,1)$, you probably want
v <- rgamma(n=1000,shape=1,rate=1)