Learn R Programming

jjAnno (version 0.0.3)

annoPoint2: annoPoint2

Description

This function is used to add points annotations in plot.

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).

aesGroup

Whether use your group column to add rect annotation. Default("FALSE").

aesShape

Whether force the point shape mapping to the aesGroName. Default("FALSE").

aesGroName

The mapping column name. Default(NULL).

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).

pFill

The point fill colors. Default(NULL).

ptSize

The point size. Default(3).

ptShape

The point shape. Default(NULL).

annoManual

Whether annotate by yourself by supplying with x and y coordinates. Default(FALSE).

addText

Whether add text label on segment. Default(FALSE).

textCol

The text colors. Default(NULL).

textSize

The text size. Default(NULL).

fontfamily

The text fontfamily. Default(NULL).

fontface

The text fontface. Default(NULL).

textLabel

The text textLabel. Default(NULL).

textRot

The text angle. Default(NULL).

textHVjust

The text distance from the segment. Default(0.2).

hjust

The text hjust. Default(NULL).

vjust

The text vjust. Default(NULL).

myFacetGrou

Your facet group name to be added with annotation when object is a faceted object. Default(NULL).

aes_x

= NULL You should supply the plot X mapping name when annotate a facetd plot. Default(NULL).

aes_y

= NULL You should supply the plot Y mapping name when annotate a facetd plot. Default(NULL).

Author

Junjun Lao

Examples

Run this code
# ===============================
# test function
data(p)

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

# change relative distance
annoPoint2(object = p,
          annoPos = 'top',
          xPosition = c(1:10),
          relSideDist = 0)

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

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

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

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

# change point size and shape
p1 <- annoPoint2(object = p,
                annoPos = 'top',
                xPosition = c(1:10),
                ptSize = 2,
                ptShape = 25)

# add to right
annoPoint2(object = p1,
          annoPos = 'right',
          yPosition = c(1:10),
          ptSize = 2,
          ptShape = 23)

# add manually
annoPoint2(object = p,
          annoPos = 'right',
          annoManual = TRUE,
          yPosition = c(1:10),
          xPosition = c(1:10))

Run the code above in your browser using DataLab