-2

I have a data frame whose one of the column has this data. [email protected]; [email protected]; [email protected]

    q= tibble("[email protected]; [email protected]; [email protected]")
    separate_rows(q,sep = ";")
Dave2e
  • 22,192
  • 18
  • 42
  • 50
AJAY
  • 73
  • 5

2 Answers2

3

You need to specify the column. For your one and only column:

separate_rows(q,1 ,sep = ";") 

# A tibble: 3 × 1
  `"[email protected]; [email protected]; [email protected]"`
  <chr>                                                   
1 "[email protected]"                                      
2 " [email protected]"                                     
3 " [email protected]" 
Dave2e
  • 22,192
  • 18
  • 42
  • 50
2

It would be clearer if you named the column. And you might want to use "; " (with a space) as the separator

q <- tibble(email = "[email protected]; [email protected]; [email protected]")
q %>% 
  separate_rows(email, sep = "; ")

Result:

# A tibble: 3 x 1
  email           
  <chr>           
1 [email protected]
2 [email protected]
3 [email protected]
neilfws
  • 32,751
  • 5
  • 50
  • 63