0

Input data from Excel file

Desired Output[Output]

Here is the code I am using:

I read the test input into the data frame 'noah5yrs'. Then, in the output for each year, I want 'Year' to be in ascending order but 'winloss' to be in descending order. How can I do that?

noah5yrs %>% mutate(winloss = substring(Rslt,1,1)) %>% group_by(Year, winloss) %>% summarize(mean_GSc = mean(GSc, na.rm=TRUE), sdGSc = sd(GSc, na.rm=TRUE))
Metsfan
  • 285
  • 1
  • 6
  • 1
    %>% arrange(Year,desc(winloss)) , sorry did not see that your winloss is factor – StupidWolf Jan 15 '20 at 15:26
  • Thanks StupidWolf. That is what I needed to know. – Metsfan Jan 15 '20 at 15:55
  • With such a small data sample, why not just post the data as in the question so folks don't have to download from a third party? And include the desired output as text instead of a picture? See the [guidance](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) on reproducible R posts – camille Jan 15 '20 at 16:23

0 Answers0