I am using the Emacs-Speaks-Statistics (ESS) mode for Emacs. When editing R code, any comment lines (those starting with #) automatically get tabbed to the far right when I
Setting ess-indent-with-fancy-comments to nil will remove the weird single-# indentation, but it must be set either buffer-locally in a hook (as in Rob's answer), OR before ESS is loaded:
(setq ess-indent-with-fancy-comments nil)
(require 'ess)
Other ways to make sure it is set before ESS is loaded, is to set it in M-x configure, or to set it in the :init section of use-package.
What's going on is that ESS defines styles at initialization in ess-style-alist, and then applies the default style in every buffer. So to make sure these styles respect ess-indent-with-fancy-comment, you must make sure to set it before the styles are defined.