Last data update: 2014.03.03

R: Row and Column Profiles of a Contingency Table
plotctR Documentation

Row and Column Profiles of a Contingency Table

Description

It plots barplot profiles of rows or columns from a contingency table including marginal profiles

Usage

plotct(x,profiles="both",legend.text=TRUE,tables=FALSE,nd=1,... )

Arguments

x

contingency table

profiles

select profiles: "both" file and column profiles in two graph devices, "row" only row profiles, "col" only column profiles

legend.text

if it is TRUE a box with legends is included at the right

tables

logical, if TRUE tables with marginals are returned

nd

number of decimals to profiles as percentages

...

further arguments passed to or from other methods

Details

Plot row profiles in horizontal form and columns profiles in vertical form

Value

if tables=TRUE, object of class list with the following:

ct

contingengy table with row and column marginals

perR

row profile with marginal, in percent

perC

column profile with marginal, in percent

Author(s)

Camilo Jose Torres cjtorresj@unal.edu.co , Campo Elias Pardo cepardot@unal.edu.co http://www.docentes.unal.edu.co/cepardot

Examples

mycolors<-colors()[c(1,26,32,37,52,57,68,73,74,81,82,84,88,100)]
data(Bogota)
plotct(Bogota[,2:7],col=mycolors)
# return tables with marginals
tabs <- plotct(Bogota[,2:7],col=mycolors,tables=TRUE,nd=0)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(FactoClass)
Loading required package: ade4
Loading required package: xtable
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/FactoClass/plotct.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plotct
> ### Title: Row and Column Profiles of a Contingency Table
> ### Aliases: plotct
> ### Keywords: hplot
> 
> ### ** Examples
> 
> mycolors<-colors()[c(1,26,32,37,52,57,68,73,74,81,82,84,88,100)]
> data(Bogota)
> plotct(Bogota[,2:7],col=mycolors)
dev.new(): using pdf(file="Rplots851.pdf")
> # return tables with marginals
> tabs <- plotct(Bogota[,2:7],col=mycolors,tables=TRUE,nd=0)
dev.new(): using pdf(file="Rplots852.pdf")
> 
> 
> 
> 
> 
> dev.off()
png 
  2 
>