Created
February 2, 2016 22:27
-
-
Save aurielfournier/bcca1f7952ebcb283260 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> head(amelt) | |
jdate year variable value | |
1 227 2013 pred_short 7.737878 | |
2 247 2013 pred_short 38.029255 | |
3 269 2013 pred_short 114.233338 | |
4 237 2013 pred_short 64.805227 | |
5 257 2013 pred_short 154.760291 | |
6 284 2013 pred_short 88.092093 | |
I want to have this | |
jdate 2013 2014 2015 | |
227 | |
247 | |
... | |
filled with the median value for each combination . | |
can't spread() do that? |
Forgot the preamble:
library(magrittr)
import::from(tidyr, spread)
import::from(dplyr, group_by, summarize)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't have the full dataset so I'm not sure how many combinations there are or if jdate is repeated, but try something like:
Does that help?