ggplot_line_point {tip}R Documentation

Plot connected points using ggplot2

Description

A function to that produces a ggplot2 plot of .y versus .x where points are added via geom_point() and the points are connected via geom_line().

Usage

ggplot_line_point(.x, .y, .xlab = "", .ylab = "")

Arguments

.x

The variable on the horizontal axis.

.y

The variable on the vertical axis.

.xlab

Character: the label on the horizontal axis.

.ylab

Character: the label on the vertical axis.

Value

ggplot2 geom_line + geom_point plot: a ggplot2 plot of .y versus .x with a label .xlab on the horizontal axis and label .ylab on the vertical axis.

Examples

# Import the tip library
library(tip)

# Create the variable that appears on the horizontal axis
x <- 1:10

# Create the variable that appears on the vertical axis
y <- rnorm(n = length(x), mean = 3, sd = 1)

# Create a label that appears on the horizontal axis
xlab <- "x"

# Create a label that appears on the vertical axis
ylab <- "y"

# Create the plot of y versus x with
ggplot_line_point(.x = x, .y = y, .xlab = xlab, .ylab = ylab)

[Package tip version 0.1.0 Index]