Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

add one column below another one in r

I have an issue in adding one column below another column.

i have a data like this :

Heading 1 Heading 2 Value
12 34 1
99 42 0

and I want that column 2 be below 1:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Heading 1 value
12 1
99 0
34 1
42 0

do you have a suggestion?
thank you in advance

>Solution :

You could do

data.frame(Heading = c(df$`Heading 1`, df$`Heading 2`), value = rep(df$Value, 2))
#>   Heading value
#> 1      12     1
#> 2      99     0
#> 3      34     1
#> 4      42     0
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading