Convert a contingency table into dataframe

0 votes
How to convert a contingency table into dataframe?
Oct 21 in Data Analytics by ch
• 3,290 points
21 views

1 answer to this question.

0 votes

The simplest way to convert the contingency table to a data frame is using as.data.frame(). 

Ex:

> el = c(1,6,2,6,2)
> el
[1] 1 6 2 6 2

> table(el)
el
1 2 6 
1 2 2 
> as.data.frame(table(el))
  el Freq
1  1    1
2  2    2
3  6    2
answered Oct 21 by Cherukuri
• 31,840 points

Related Questions In Data Analytics

0 votes
1 answer

Read table from webpage and convert it into dataframe

Hi Kalyan, Use html_table to create tables from ...READ MORE

answered Sep 17 in Data Analytics by prajwal
21 views
0 votes
0 answers

How to convert a table into tree?

I used getTree() and randomForest object to ...READ MORE

Oct 22 in Data Analytics by ch
• 3,290 points
15 views
+1 vote
1 answer

How to convert a list of vectors with various length into a Data.Frame?

We can easily use this command as.data.frame(lapply(d1, "length< ...READ MORE

answered Apr 4, 2018 in Data Analytics by DeepCoder786
• 1,720 points
130 views
+1 vote
1 answer

How to convert a list of dataframes in to a single dataframe using R?

You can use the plyr function: data <- ...READ MORE

answered Apr 13, 2018 in Data Analytics by darklord
• 6,170 points
191 views
0 votes
1 answer

By using dpylr package sum of multiple columns

Basically here we are making an equation ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
116 views
0 votes
1 answer

How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
160 views
0 votes
1 answer

In a dpylr pipline how to use sample and seq?

For avoiding rowwise(), I prefer to use ...READ MORE

answered Apr 6, 2018 in Data Analytics by DeepCoder786
• 1,720 points
87 views
0 votes
1 answer

How to create a list of Data frames?

Basically all we have to do is ...READ MORE

answered Apr 9, 2018 in Data Analytics by DeepCoder786
• 1,720 points
104 views
0 votes
1 answer

How to convert a dataframe into json data?

Hi, kalyan. Use toJSON function from jsonlite package. ...READ MORE

answered Sep 24 in Data Analytics by Cherukuri
• 31,840 points
15 views
0 votes
1 answer

R - Create a repetitive list from a smaller length vector to fit into dataframe

Hi Nithin, rep() is used to replicate a ...READ MORE

answered Aug 20 in Data Analytics by anonymous
• 31,840 points
23 views