R 我需要帮助将一个数据帧转换为另一个数据帧
我试图理解如何将pic中的数据帧转换为。如何进行转换?我们可以使用R 我需要帮助将一个数据帧转换为另一个数据帧,r,R,我试图理解如何将pic中的数据帧转换为。如何进行转换?我们可以使用收集和提取 library(tidyverse) gather(df1, year, MatriculationRates, -1) %>% extract(year, into = 'year', '[^0-9]+([0-9]+)')
收集和提取
library(tidyverse)
gather(df1, year, MatriculationRates, -1) %>%
extract(year, into = 'year', '[^0-9]+([0-9]+)')