Open In App

Plot a Geometric Distribution Graph in R Programming – dgeom() Function

Last Updated : 30 Jun, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

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:


Similar Reads

A Guide to dgeom, pgeom, qgeom, and rgeom in R
In this article, we will be looking at a guide to the dgeom, pgeom, qgeom, and rgeom methods of the geometric distribution in the R programming language. dgeom function The dgeom function finds the probability of experiencing a certain amount of failures before experiencing the first success in a series of Bernoulli trials. This returns the value o
3 min read
Set Aspect Ratio of Scatter Plot and Bar Plot in R Programming - Using asp in plot() Function
asp is a parameter of the plot() function in R Language is used to set aspect ratio of plots (Scatterplot and Barplot). Aspect ratio is defined as proportional relationship between width and height of the plot axes. Syntax: plot(x, y, asp ) Parameters: x, y: Coordinates of x and y axis asp: Aspect ratio Example 1: # Set seed for reproducibility set
1 min read
Plot Paired dot plot and box plot on same graph in R
R Programming Language is used for statistical computing and graphics. R was first developed at the University of Auckland by two professors Ross Ihanka and Robert Gentleman Dot Plot The dot plot is a graphical representation of how one attribute varies with respect to another attribute. On the x-axis, we usually plot the attribute with respect to
7 min read
Compute the Value of Geometric Quantile Function in R Programming - qgeom() Function
qgeom() Function in R Language is used to plot a graph for quantile function of Geometric Distribution. Syntax: qgeom(x, prob) Parameters: x: x-values of qgeom() function prob: prob of plot Example 1: # R program to illustrate # qgeom() function in r # Specify x-values for qgeom function x_qgeom &lt;- seq(0, 2, by = 0.1) # Apply qgeom function y_qg
1 min read
Plot Arrows Between Points in a Graph in R Programming - arrows() Function
arrows() function in R Language is used to create arrows between the points on the graph specified. Syntax: arrows(x0, y0, x1, y1, length) Parameters: x0: represents x-coordinate of point from which to draw the arrow y0: represents y-coordinate of point from which to draw the arrow x1: represents x-coordinate of point to which the arrow is drawn y1
2 min read
Plot Probability Distribution Function in R
The PDF is the acronym for Probability Distribution Function and CDF is the acronym for Cumulative Distribution Function. In general, there are many probability distribution functions in R in this article we are going to focus on the Normal Distribution among them to plot PDF. To calculate the Normal Distribution Function we have the built-in funct
3 min read
Plot Cumulative Distribution Function in R
In this article, we will discuss how to plot a cumulative distribution function (CDF) in the R Programming Language. The cumulative distribution function (CDF) of a random variable evaluated at x, is the probability that x will take a value less than or equal to x. To calculate the cumulative distribution function in the R Language, we use the ecdf
4 min read
Compute Density of the Distribution Function in R Programming - dunif() Function
dunif() function in R Language is used to provide the density of the distribution function. Syntax: dunif(x, min = 0, max = 1, log = FALSE) Parameters: x: represents vector min, max: represents lower and upper limits of the distribution log: represents logical value for probabilities Example 1: # Create vector of random deviation u &lt;- runif(20)
1 min read
Compute the Value of Empirical Cumulative Distribution Function in R Programming - ecdf() Function
ecdf() function in R Language is used to compute and plot the value of Empirical Cumulative Distribution Function of a numeric vector. Syntax: ecdf(x) Parameters: x: Numeric Vector Example 1: # R Program to compute the value of # Empirical Cumulative Distribution Function # Creating a Numeric Vector x &lt;- seq(1, 50, by = 2) # Calling ecdf() Funct
1 min read
Compute the value of F Cumulative Distribution Function in R Programming - pf() Function
pf() function in R Language is used to compute the density of F Cumulative Distribution Function over a sequence of numeric values. It also plots a density graph for F Cumulative Distribution. Syntax: pf(x, df1, df2) Parameters: x: Numeric Vector df: Degree of Freedom Example 1: # R Program to compute # Cumulative F Density # Creating a sequence of
1 min read