0

I am reasonably familiar with dplyr, but am stuck in the following issue. I have the following table.

Issue      Rejected Accepted

Issue 1    2        4
Issue 2    3        6
Issue 3    0        1

What I want to do is create a new column(Decision) which will have the accept and reject as the entries. So what I want to do is change it to the following,

Issue   Decision    Quantity

Issue 1 Rejected    2
Issue 1 Accepted    4
Issue 2 Rejected    3
Issue 2 Accepted    6
Issue 3 Rejected    0
Issue 3 Accepted    1
Psidom
  • 195,464
  • 25
  • 298
  • 322
Kulwant
  • 589
  • 2
  • 9
  • 25

1 Answers1

1
library(dplyr)
library(tidyr)
df1 <- gather(df, Issue)
colnames(df1)[2:3] <- c("Decision", "Quantity") 

df1 %>% arrange(Issue)
Sumedh
  • 4,635
  • 1
  • 16
  • 31