I'm following up on this question. I was wondering why my pivot_wider()
call below returns nested output for its 5 integer values with a warning?
library(tidyverse)
m="
intrcpt name
1 0.0303 AL
2 0.0511 PD
3 -0.269 AL
4 -0.126 PD
5 0.195 AL
6 0.0647 PD
7 0.00690 AL
8 -0.0471 PD
9 0.0375 AL
10 0.0571 PD
"
dat <- read.table(text = m,h=T)
pivot_wider(dat, 1, values_from = intrcpt, names_from = name)
# A tibble: 1 x 2
# AL PD
# <list> <list>
#1 <dbl [5]> <dbl [5]>
#Warning message:
#Values are not uniquely identified; output will contain list-cols.
#* Use `values_fn = list` to suppress this warning.
#* Use `values_fn = length` to identify where the duplicates arise
#* Use `values_fn = {summary_fun}` to summarise duplicates