ok, thanks for confirming!
I tried a workaround like this:
#+BEGIN_SRC emacs-lisp -r
(defun my-tangle-with-r ()
(interactive)
(let* ((temporary-file-directory ".")
(tmpname (make-temp-file "switch" nil ".org"))
buf
data)
(write-region (point-min) (point-max) tmpname)
(setq buf (find-file-noselect tmpname))
(with-current-buffer buf
(setq data (org-element-parse-buffer))
(org-element-map data 'src-block
(lambda (src)
(org-element-put-property src :switches "-r")))
(erase-buffer)
(insert (org-element-interpret-data data))
(save-buffer)
(org-babel-tangle))
(kill-buffer buf)
(delete-file tmpname)))
#+END_SRC
Any suggestions for improvement? It seems to work for me, but says it tangled from the temp file instead of the main file (that is expected, but not ideal). I tried some simpler ways but with org-export-with-buffer-copy, for example, I ran into difficulties because of the buffer modification, which I could find a way around that didn't lead to many copies of the buffer being open. In this solution, I just save it and have no issue there.
John
-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803