sdcurve: Supply and demand curves

Description Usage Arguments Examples

View source: R/sdcurve.R

Description

Create supply and demand curves. By default, the function will use a default supply and a default demand curve, but this can be overridden passing new curves as additional arguments or modifying the xmax and ymax arguments. Moreover, the function provides several arguments to customize the final output, like displaying the equilibrium points, the name of the curves, customizing the title, subtitle or axis labels, among others.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
sdcurve(
  ...,
  xmax,
  ymax,
  max.price,
  min.price,
  generic = TRUE,
  equilibrium = TRUE,
  main = NULL,
  sub = NULL,
  xlab = NULL,
  ylab = NULL,
  curve_names = TRUE,
  names,
  linescol,
  bg.col = "white"
)

Arguments

...

Specify the demand and supply curve or curves separated by commas (as data.frame) you want to display in the graph, starting with supply. This will override the sample curves.

xmax

Numeric. Allows modifying the maximum X value for the default functions.

ymax

Numeric. Allows modifying the maximum Y value for the default functions.

max.price

Price ceiling.

min.price

Price floor.

generic

Boolean. If TRUE, the axis labels shows generic names. If FALSE, the axis labels are the actual data of the axis that corresponds to the intersection points between the two curves.

equilibrium

Boolean. If TRUE, shows the intersection points between the two curves.

main

Main title of the plot.

sub

Subtitle of the plot.

xlab

Name of the X-axis.

ylab

Name of the Y-axis.

curve_names

Boolean. If TRUE, the function adds default names to each.

names

If curve_names = TRUE, are custom names for the curves.

linescol

Color of the curves. It must be a vector of the same length as the number of displayed curves.

bg.col

Background color of the plot.

Examples

1
#TODO

R-CoderDotCom/econocharts documentation built on Oct. 16, 2021, 12:42 p.m.