You can specify the columns you want to keep in long format by including them in the values_from
argument of pivot_wider
function. Here's an example:
416 chars21 lines
In this code snippet, only the 'value' column is pivoted from long to wide format while 'id' and 'name' columns are kept in long format.
gistlibby LogSnag