0

I have a data set with observations over time and there is more than 1 observation per date. I want to gather in a single row the observations of a same day but I am not sure how, is there a function that does that in R?

Naj
  • 1
  • 1
  • 3
    You probably want to look at `spread` in the `tidyr` package. But consider whether you *really* want to make your data "wide", instead of "long". Long data (1 row per observation) is often easier to analyse in R. Also, please provide some example data and example desired output. – neilfws Nov 14 '18 at 22:42
  • You should provide a reproducible example in order for us to test possible solutions and to understand exactly what you mean in your question. – Cris Nov 14 '18 at 23:54
  • have a look at those links here: https://stackoverflow.com/help/how-to-ask https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example https://stackoverflow.com/help/mcve and the following should help with your particular question: https://tidyr.tidyverse.org/reference/spread.html – tjebo Nov 15 '18 at 11:38
  • Possible duplicate of [How to reshape data from long to wide format?](https://stackoverflow.com/questions/5890584/how-to-reshape-data-from-long-to-wide-format) – phiver Nov 17 '18 at 12:14

0 Answers0