Last data update: 2014.03.03

R: Table -> data.frame
table.to.dataR Documentation

Table –> data.frame

Description

Creates a data.frame from a table

Usage

table.to.data(x)

Arguments

x

A matrix or table representing the cross tabulation of two variables

Value

A two column data.frame where each row is an observation and each column is a variable.

See Also

xtabs

Examples

tab<-matrix(c(4,5,6,9,7,3),ncol=3)
tab
table.to.data(tab)

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(Deducer)
Loading required package: ggplot2
Loading required package: JGR
Loading required package: rJava
Loading required package: JavaGD
Loading required package: iplots

Please type JGR() to launch console. Platform specific launchers (.exe and .app) can also be obtained at http://www.rforge.net/JGR/files/.


Loading required package: car
Loading required package: MASS


Note Non-JGR console detected:
	Deducer is best used from within JGR (http://jgr.markushelbig.org/).
	To Bring up GUI dialogs, type deducer().

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Deducer/table.to.data.Rd_%03d_medium.png", width=480, height=480)
> ### Name: table.to.data
> ### Title: Table -> data.frame
> ### Aliases: table.to.data
> 
> ### ** Examples
> 
> tab<-matrix(c(4,5,6,9,7,3),ncol=3)
> tab
     [,1] [,2] [,3]
[1,]    4    6    7
[2,]    5    9    3
> table.to.data(tab)
   V1 V2
1   1  1
2   1  1
3   1  1
4   1  1
5   1  2
6   1  2
7   1  2
8   1  2
9   1  2
10  1  2
11  1  3
12  1  3
13  1  3
14  1  3
15  1  3
16  1  3
17  1  3
18  2  1
19  2  1
20  2  1
21  2  1
22  2  1
23  2  2
24  2  2
25  2  2
26  2  2
27  2  2
28  2  2
29  2  2
30  2  2
31  2  2
32  2  3
33  2  3
34  2  3
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>