Convert a contingency table into dataframe

0 votes
How to convert a contingency table into dataframe?
Oct 21, 2019 in Data Analytics by ch
• 3,380 points
33 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, 2019 by Cherukuri
• 32,420 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, 2019 in Data Analytics by prajwal
41 views
0 votes
0 answers

How to convert a table into tree?

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

Oct 22, 2019 in Data Analytics by ch
• 3,380 points
29 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
148 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 Sahiti
• 6,290 points
246 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
146 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
208 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
96 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
123 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, 2019 in Data Analytics by Cherukuri
• 32,420 points
27 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, 2019 in Data Analytics by anonymous
• 32,420 points
36 views