I tried to convert my long format data to wide format, and I got the error "Error: Incompatible lengths: 36, 37". I would be grateful if anyone could suggest to me how can I unnest them using tidyverse or dplyr package in R.
It is difficult to be sure I understand correctly your point since we do not have a minimal reprex example but I would suggest to carefully look at your columns and that one of these can not be included in the pivot_wide() .
please see also this post from stackoverflow https://stackoverflow.com/questions/64017695/r-error-incompatible-lengths-when-using-unnest-in-dplyr