help with ggplot2 code

could you please help to modify this below ggplot2 code; I would like to add some more variable to this code; would like to color based on city; and then also would like to wrap based on variables (x axis) and elements ( y axis);

ggplot(pred.resp.univar, aes(z, est, ymin = est - 1.96*se, 
                             ymax = est + 1.96*se)) + 
    geom_smooth(stat = "identity") + 
    facet_wrap(~variable, ncol = 4) +
    xlab("expos") +
    ylab("h(expos)")

Many thanks

Hi,

It would be easier for folks here to help if you supplied data by following these steps:

  1. Run this code, exactly as written:
# redirect console output to the new file, "data_for_posit.txt"
sink("data_for_posit.txt")  
# print contents of first 100 rows to file
head(pred.resp.univar, 100) |>
  dput()
# redirect output back to console (very important!)
sink()
  1. Open the file "data_for_posit.txt", select all, copy, and then paste here between a pair of triple backticks, like this:
``` r
[<-- paste dput() output here]
```

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.