How to split two rows in multiples row in R
I have a dataset like this (1st) and I want to turn him into this format (2st)!
• 1,895 views
•
link
1 answer
What you are looking for is probably:
b <- matrix(a, ncol=8, byrow = TRUE)
Then rename column names and transform to data.frame if you wish.
• 0 views
•
link
Log in to answer this question.
See the
pivot_longerfunction from thetidyrpackage. https://tidyr.tidyverse.org/reference/pivot_longer.htmlWhere are you getting the values for column1 in the output df from?
sorry for the lack of information, but basically there are several files (each with the name in column 1) that I joined in a file only through "list.files()". the second image I made manually by excel, but this is not good, because later I will have many more files to join and format in a dataframe.
I started my first contact with bioinformatics in biology graduation, so I have no experience
Please show us your full code, starting from the
list.files()command.