I have a large matrix where the rownames are sample ID and the only column contains a list of information, ex: c("xyz","abc","def" [...])
and I'd like to expand this information for each sample ID so that the new matrix would read:
| rownames | column1 |
|---|---|
| SampleID | xyz |
| SampleID | abc |
| SampleID | def |
Would a function like tidyr's unnest() be appropriate?
You can try
which gives
Or, you can use
unnestlike belowwhich gives
data