我想从一个Excel工作表(母版)中提取特定数据,然后将其放入另一个Excel工作表中。在下面放置示例:
Excel1:
SN Name Location Degree Skill Skill Value 1 Nam1 Loc1 Deg1 Skill1 Yes 2 Nam1 Loc1 Deg1 Skill2 No 3 Nam2 Loc2 Deg2 Skill1 No 4 Nam2 Loc2 Deg2 Skill2 YesExcel2:
Name Location Degree Skill1 Skill2 Nam1 Loc1 Deg1 Yes No Name2 Loc2 Deg2 No Yes
答案 0 :(得分:1)
如果要在R中进行操作,那很简单。
library(tidyverse)
data %>%
select(-SN) %>%
spread(key='Skill', value=`Skill Value`)
输出:
Name Location Degree Skill1 Skill2
<chr> <chr> <chr> <chr> <chr>
1 Nam1 Loc1 Deg1 Yes No
2 Nam2 Loc2 Deg2 No Yes