I have a set of data:
name<-c("A","B","C")
type<-c("U","","D")
content<-c("ABC (0001 - test), CCC (0002 - test1), DDD (0004 - test 2)", "CCC (0002 - test1)", "N/A")
data<-data.frame(name,type,content)
It looks like this:
name type content
A U ABC (0001 - test), CCC (0002 - test1), DDD (0004 - test 2)
B CCC (0002 - test1)
C D N/A
In R, could I transform it to:
name type content code
A U ABC (0001 - test) 0001
A U CCC (0002 - test1) 0002
A U DDD (0004 - test 2) 0004
B CCC (0002 - test1) 0002
C D N/A N/A
I am not sure if I can do this in R? Could anyone help?
Very new to R, so some explanations would be appreciated.