Related Articles
Plot a Geometric Distribution Graph in R Programming – dgeom() Function
• Last Updated : 30 Jun, 2020

`dgeom()` function in R Programming is used to plot a geometric distribution graph.

Syntax: dgeom(x, prob)

Parameters:

• prob: prob of the geometric distribution
• x: x values of the plot

Example 1:

 `# R program to illustrat``# dgeom function to plot`` ` `# Specify x-values for dgeom function``x_dgeom <``-` `seq(``2``, ``10``, by ``=` `1``)    `` ` `# Apply dgeom function ``y_dgeom <``-` `dgeom(x_dgeom, prob ``=` `0.5``)    `` ` `# Plot dgeom values ``plot(y_dgeom)                                                                         `

Output:

Example 2:

 `# R program to illustrate``# dgeom() function to plot`` ` `# Specify x-values for dgeom function``x_dgeom <``-` `seq(``1``, ``7``, by ``=` `1``)    `` ` `# Apply dgeom function ``y_dgeom <``-` `dgeom(x_dgeom, prob ``=` `0.05``)    `` ` `# Plot dgeom values ``plot(y_dgeom)     `

Output:

My Personal Notes arrow_drop_up