Hi, I'm having issues with pivot_wider. I keep getting this error code:
Warning message:
Values in ppg
are not uniquely identified; output will contain list-cols.
- Use
values_fn = list(ppg = list)
to suppress this warning. - Use
values_fn = list(ppg = length)
to identify where the duplicates arise - Use
values_fn = list(ppg = summary_fun)
to summarise duplicates
I have tried creating a row number but this doesn't work. Any help would be appreciated.
I have run code to re-produce my example:
dput(head(df_long, n = 20))
structure(list(pos = c("D", "F", "F", "F", "F", "F", "F", "F",
"D", "D", "D", "D", "D", "F", "F", "F", "F", "F", "F", "F"),
age.group = c("late", "early", "early", "early", "early",
"early", "early", "early", "early", "early", "early", "early",
"early", "early", "early", "early", "early", "early", "early",
"early"),DY+/-
= structure(c(1L, 1L, 4L, 5L, 1L, 4L, 5L,
6L, 2L, 1L, 4L, 5L, 6L, 1L, 4L, 5L, 6L, 5L, 5L, 1L), .Label = c("DY",
"DY-1", "DY-2", "DY+1", "DY+2", "DY+3"), class = "factor"),
ppg = c(0.16, 0.8088, 0.8525, 1.2115, 0.3051, 0.403, 0.6508,
1.0909, 0.2381, 0.2623, 0.4167, 0.2615, 0.3, 0.3433, 0.7794,
0.8676, 1.6912, 0, 0.5116, 0.0909), player = c("a.j.-cook",
"a.j.-jenks", "a.j.-jenks", "a.j.-jenks", "aaron-berisha",
"aaron-berisha", "aaron-berisha", "aaron-berisha", "aaron-haydon",
"aaron-haydon", "aaron-haydon", "aaron-haydon", "aaron-haydon",
"aaron-luchuk", "aaron-luchuk", "aaron-luchuk", "aaron-luchuk",
"aaron-scott", "aaron-snow", "aaron-taylor")), row.names = c(NA,
-20L), class = c("tbl_df", "tbl", "data.frame"))
Thank you.