Dale W.

asked • 06/24/25

pivot_wider() in {tidyverse}

I have a project where I need to restructure my dataframes. I am using pivot_wider but I cannot produce what I need. I need more columns to appear in the output (nut_w). Happy to hire a tutor is familiar with data restructuring. Should I pursue with tidyverse or go back to base R? Thank you.


# nutrients

nut_w 

 pivot_wider(

  id_cols = c(Reference_ID, Date), # each row represents a unique station-date combination

  names_from = c(Functional_Group,Media,Fraction),

  values_from = Value

 )

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.