converting a long-formated dataframe to wide format tidyverse [duplicate]
问题 This question already has answers here : How to reshape data from long to wide format (12 answers) Closed 3 months ago . Below I first successfully long-format my dat , but when I try to convert it back to its original wide-format I don't get the same output. Is there a fix for this? library(tidyverse) ACGR <- read.csv('https://raw.githubusercontent.com/rnorouzian/e/master/ACGR%202010-11%20to%202016-17.csv', na = "---") dat <- ACGR %>% pivot_longer(names_to = "year", values_to = "grad_rate",