Learn R Programming

jjAnno (version 0.0.3)

annoPoint: annoPoint

Description

This function is used to add points annotations in plot.

Usage

annoPoint(
  object = NULL,
  relSideDist = 0.1,
  annoPos = "top",
  xPosition = NULL,
  yPosition = NULL,
  pCol = NULL,
  ptSize = 3,
  ptShape = NULL
)

Value

Return a ggplot object.

Arguments

object

Your ggplot list. Default(NULL).

relSideDist

The relative distance ratio to the y axis range. Default(0.1).

annoPos

The position for the annotation to be added. Default("top").

xPosition

The x axis coordinate for the points. Default(NULL).

yPosition

The y axis coordinate for the points. Default(NULL).

pCol

The point colors. Default(NULL).

ptSize

The point size. Default(3).

ptShape

The point shape. Default(NULL).

Author

Junjun Lao

Examples

Run this code
# ===============================
# test function

# load data
data(p)

# default plot
annoPoint(object = p,
          annoPos = 'top',
          xPosition = c(1:10))

# specify yPosition
annoPoint(object = p,
          annoPos = 'top',
          xPosition = c(1:10),
          yPosition = rep(c(2,4,2,6,4),each = 2))

# add right
annoPoint(object = p,
          annoPos = 'right',
          yPosition = c(1:10))

# left
annoPoint(object = p,
          annoPos = 'left',
          yPosition = c(1:10))

# supply xPosition to ajust
annoPoint(object = p,
          annoPos = 'right',
          yPosition = c(1:10),
          xPosition = 0.3)

Run the code above in your browser using DataLab