Learn R Programming

XGR (version 1.1.4)

xPolarBar: Function to visualise a data frame using a polar barplot

Description

xPolarBar is supposed to visualise a data frame using a polar dotplot. It returns an object of class "ggplot".

Usage

xPolarBar(df, colormap = "spectral", size.name = 10, size.value = 3,
parallel = FALSE, font.family = "sans", signature = TRUE)

Arguments

df

a data frame with two columns ('name' and 'value')

colormap

either NULL or color names ('spectral' by default) for bars according to the name column

size.name

an integer specifying the text size for the name column. By default, it sets to 10

size.value

an integer specifying the text size for the value column. By default, it sets to 3

parallel

logical to indicate whether the label is parallel to polar coordinate. By default, it sets FALSE

font.family

the font family for texts

signature

logical to indicate whether the signature is assigned to the plot caption. By default, it sets TRUE showing which function is used to draw this graph

Value

an object of class "ggplot"

See Also

xPolarBar

Examples

Run this code
# NOT RUN {
# Load the XGR package and specify the location of built-in data
library(XGR)
RData.location <- "http://galahad.well.ox.ac.uk/bigdata/"

# }
# NOT RUN {
# a) provide the seed nodes/genes with the weight info
## load ImmunoBase
ImmunoBase <- xRDataLoader(RData.customised='ImmunoBase',
RData.location=RData.location)
## get genes within 500kb away from AS GWAS lead SNPs
seeds.genes <- ImmunoBase$AS$genes_variants
## seeds weighted according to distance away from lead SNPs
data <- 1- seeds.genes/500000

# b) prepare a data frame
df <- data.frame(name=names(data), value=data, stringsAsFactors=FALSE)

# c) do correlation
gp <- xPolarBar(df[1:20,], parallel=TRUE)
gp
# }

Run the code above in your browser using DataLab