Can rows be converted into columns in R?

0 votes
Can rows be converted into columns in R?
Dec 11, 2018 in Data Analytics by Ali
• 10,290 points
27 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

You can use of the R package called tidyr. Something like this:

library(tidyr)
txt <- read.delim(text = "SUBD | X1 | X2
0 |.789|.655
1 |.889|.998", sep = "|")
gather(txt, WK, Per, -SUBD)
answered Dec 11, 2018 by Maverick
• 10,000 points

Related Questions In Data Analytics

0 votes
2 answers

Transforming a key/value string into distinct rows in R

We would start off by loading the ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,550 points
27 views
0 votes
1 answer

How can I remove duplicated rows in R ?

The function distinct() in the dplyr package ...READ MORE

answered Apr 26, 2018 in Data Analytics by shams
• 3,580 points
301 views
0 votes
3 answers

Can a C program be written in R programming language?

If you have a algorithm you can ...READ MORE

answered Apr 9 in Data Analytics by anonymous
42 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,700 points
60 views
0 votes
1 answer

Error saying "vector size cannot be NA" when using R with data mining

You can use the removesparseterm function.  Removes sparse ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,000 points
186 views
0 votes
1 answer

Trying to find frequent itemsets of a data set using arules package

Try replacing ID <- c("A123","A123","A123","A123","B456","B456","B456") item <- c("bread", "butter", "milk", ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,000 points
16 views
0 votes
1 answer

Error saying "Error in df$item : object of type 'closure' is not subsettable" when trying to use arules package

Try replacing ID <- c("A123","A123","A123","A123","B456","B456","B456") item <- c("bread", "butter", ...READ MORE

answered Nov 15, 2018 in Data Analytics by Maverick
• 10,000 points
51 views
0 votes
1 answer

Can R and hadoop be used together to get better results?

The most common way to link R ...READ MORE

answered Nov 2, 2018 in Data Analytics by Maverick
• 10,000 points
14 views
+1 vote
2 answers

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.