@premsheth wrote:
Hello,
I want to make different columns from sublist in R
Example:head(data$product_category_tree)
output:
[1] "[\"Clothing >> Women's Clothing >> Lingerie, Sleep & Swimwear >> Shorts >> Alisha Shorts >> Alisha Solid Women's Cycling Shorts\"]" [2] "[\"Furniture >> Living Room Furniture >> Sofa Beds & Futons >> FabHomeDecor Fabric Double Sofa Bed (Finish Colo...\"]" [3] "[\"Footwear >> Women's Footwear >> Ballerinas >> AW Bellies\"]" sam <- strsplit(data$product_category_tree,">>") head(sam)
output
[[1]] [1] "[\"Clothing " " Women's Clothing " [3] " Lingerie, Sleep & Swimwear " " Shorts " [5] " Alisha Shorts " " Alisha Solid Women's Cycling Shorts\"]" [[2]] [1] "[\"Furniture " [2] " Living Room Furniture " [3] " Sofa Beds & Futons " [4] " FabHomeDecor Fabric Double Sofa Bed (Finish Colo...\"]" [[3]] [1] "[\"Footwear " " Women's Footwear " " Ballerinas " " AW Bellies\"]"
Now I want to extract information as particular levels or make function so I will able to extract information at particular level.
can anyone please suggest me how to make For loops for it or make function ?
Thanks in Advance
Posts: 1
Participants: 1