Hi there I have transform my arules into data frame for further analysis but the problem is my data frame looks like this:
df <- data.frame(rules=c("{45107} => {62557}","{17759} => {60521 }",
"{53721} => {53720}","{63830} => {17753}","{45413} => {45412}",
"{3885,59800,17759} => {4749}","{17721,55906} => {9314}"))
rules
{45107} => {62557}
{17759} => {60521 }
{53721} => {53720}
{63830} => {17753}
{45413} => {45412}
{3885,59800,17759} => {4749}
{17721,55906} => {9314}
Can you help me change my data frame into this format?
lhs1 lhs2 lhs3 rhs
45107 62557
17759 60521
53721 53720
63830 17753
45413 45412
3885 59800 17759 4749
17721 55906 9314
With your data.frame df and putting all numbers after
=>
inrhs
:Is that ok or do you want the new data.frame to be exactly like the one displayed in your question ?