Closed youngsaver closed 6 years ago
Sometimes you have to create a new variable to sort by - I call it sort
or tmp_sort
that is based on the attribute you want and is a sequential integer, then just reorder based on that.
Made the fix. It was actually a problem higher up in the code that made the ordering later in the code go wacky.
In the R markdown code, in the chunk "SchoolGaps," I am having a hard time ordering the boxplots for the three lowest performing schools. I want them to order such that the lowest median school is to the left, ascending towards the right. However, either the ordering is off or the boxplots aren't matching to the school codes because schools that are supposed to have lower medians appear to have higher medians in the plot. I've tried various strategies (using
reorder
or changing between characters and ordered factors), and I'm going to have to work on this some more to resolve.