Skip to content

Commit

Permalink
fix label order
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Nov 20, 2023
1 parent d69ea9d commit c56b208
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions vignettes/parameters.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,14 @@ By default, `model_parameters()` returns a data frame, where the parameter names
plot(model_parameters(model4))
```

However, there are several ways to change the the names of the parameters. Since `plot()` returns *ggplot* objects, these can be easily modified, e.g. by adding a `scale_y_discrete()` layer.
However, there are several ways to change the the names of the parameters. Since `plot()` returns *ggplot* objects, these can be easily modified, e.g. by adding a `scale_y_discrete()` layer. *Note the correct order of the labels!*

```{r}
library(ggplot2)
plot(model_parameters(model4)) +
scale_y_discrete(labels = c(
"Time", "Age", "Education (mid-level)",
"Eucation (high-level)"
))
scale_y_discrete(
labels = c("Eucation (high-level)", "Education (mid-level)", "Age", "Time")
)
```

Another way would be changing the values of the `Parameter` column before calling `plot()`:
Expand Down

0 comments on commit c56b208

Please sign in to comment.