# How could my suggested edit have been improved?

I recently made a suggested edit to a post: https://codereview.stackexchange.com/review/suggested-edits/149799

In brief, I added an import statement (library(dplyr)) to the code in the question, because the code is not runnable without importing the relevant library (I should know, since I answered the question and couldn't run the code initially until I ran the statement I added). I tried to capture this with the suggested edit comment: "Add a necessary library include to make the code runnable"

The suggested edit was unanimously rejected, with the following two reasons:

• This edit deviates from the original intent of the post. Even edits that must make drastic changes should strive to preserve the goals of the post's owner.
• The edit does not improve the quality of the post. Changes to the content are unnecessary or make the post more confusing.

Both of these reasons seem wrong to me -- clearly it's not a drastic change and clearly it's not unnecessary or confusing (it's needed to make the code runnable, which is a requirement of all code posted on this site).

Was there something I could have done to improve my suggested edit (e.g. a better comment)? Is this just a hiccup where I got two unlucky reviewers and the suggested edit was fine?

This would've been better as a comment.

Code edits in questions are almost always rejected unless they're discussed in the comments first. Reviewers in the edit queue won't know all languages and won't know all the details of a post. So you may well have been right, but you can't expect the reviewer to know that. If code in a question seems flawed, the proper action is a comment. If the code is not reviewable without the change, the proper action is a comment and flagging/voting to close.

There are more pragmatic reasons for this. One of them is that some IDE auto-import missing libraries and thus the imports won't have been part of the original code. That's a reviewable point and we don't edit reviewable points into the question (unless they're obvious copy-paste mistakes).