R中一对多转换至一对一的格式
2022-10-05 本文已影响0人
队长的生物实验室
效果如下:
![](https://img.haomeiwen.com/i25125421/e985171e79ebba12.png)
![](https://img.haomeiwen.com/i25125421/bc7b552e6d261561.png)
library(tidyr)
df <- read.csv("RGB_GO_background.csv",header=T)
df2 <-df %>% as_tibble() %>%
separate_rows(SprotGO, sep = "; ")
效果如下:
library(tidyr)
df <- read.csv("RGB_GO_background.csv",header=T)
df2 <-df %>% as_tibble() %>%
separate_rows(SprotGO, sep = "; ")