Hi all I wonder if someone could help me with something thats got me stuck starting out in R? Similar to this post but in R.
Essentially the opposite of the R.utils function seqToHumanReadable.
Namely
Title | LLFCs | Red |
---|---|---|
a | 15, 18 | 11.65 |
b | 16 & 19 | 9.08 |
c | 112-114 | 6.45 |
d | 113-115,145-147 | 6.45 |
Would become:
Title | LLFCs | Red |
---|---|---|
a | 15 | 11.65 |
a | 18 | 11.65 |
b | 16 | 9.08 |
b | 19 | 9.08 |
c | 112 | 6.45 |
c | 113 | 6.45 |
c | 114 | 6.45 |
d | 113 | 6.45 |
d | 114 | 6.45 |
d | 115 | 6.45 |
d | 145 | 6.45 |
d | 146 | 6.45 |
d | 147 | 6.45 |
Thanks so much in advance for any help!
I started trying an if, working out the difference from each of the hyhenated numbers and running though this many times with a loop trying to add additional rows but got in an awful mess.
EDIT: Wow thank you all so much for the replies. Solved my problem and given me a whole lot more to read up on!