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,450 points
1,728 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
• 33,030 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
1,747 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,450 points
980 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
1,666 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 14, 2018 in Data Analytics by Sahiti
• 6,370 points
7,043 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
2,253 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
1,925 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

edited Jun 9, 2020 by Gitika 1,184 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
1,343 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
• 33,030 points
2,396 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 21, 2019 in Data Analytics by anonymous
• 33,030 points
624 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP