

I would like to average the the selectedES.prepost variable, so that for each averages all the values of the Paper variable by levels. My variable names will be for this example: I’m adding more information to try to make my question/example reproducible If it's truly confidential, I'm afraid you'll need to make a fake sample dataset to share. If your data set can't be shared, run this line instead and paste the output into your post (and yes, format as code!) This will still share some information about your data.If your data set is OK to share, run the following line and paste the output into your post.
SAVING ATTRIBUTES IN A FOR LOOP IN R CODE
Be sure to format your code as code (it's really hard to read code that isn't formatted properly) It's OK it doesn't work! It's really helpful to see what you've been attempting. Edit your post and add in some of the code you have tried.

If you try all that and get stuck, here's a fallback option. To include your data, you'll want to follow one of the methods discussed here. The best thing would be if you can make your question into a reproducible example (follow the link for instructions and explanations). Welcome! I'm afraid you'll need to supply some more info in order for helpers to be able to understand your problem (this is pretty common - when you're new to this stuff, it's hard to know how much information is enough!).
