Entering edit mode
2.3 years ago
joaovmio
•
0
I have a dataset like this (1st) and I want to turn him into this format (2st)!
I have a dataset like this (1st) and I want to turn him into this format (2st)!
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.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
See the
pivot_longer
function from thetidyr
package. 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.