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,450 points
31 views

1 answer to this question.

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,040 points

Related Questions In Data Analytics

0 votes
0 answers

Convert columns into rows in R Data frame

Can we convert columns into rows in ...READ MORE

Jul 12 in Data Analytics by Anita
14 views
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
46 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
474 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
48 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,040 points
290 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,040 points
28 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,040 points
82 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,040 points
17 views
+1 vote
2 answers