I made a post about this on Stackexchange but no one answered.
I'm trying to start using Python and want to use the RStudio IDE as it's what I'm used to.
I cannot seem to get .Rmd code chucks to run all at once, Rmds just run each line one after another. This isn't the case when I click "run current chunk"
Consider a basic loop I found online :
fruits = ["apple", "banana", "cherry"]
for x in fruits:
print(x)
This is what I get when I try to run pressing CTRL+Enter (in R, if I were to make a loop, function, or use magrittr, the entirely of the "chunk"/code block would just run)
Unfortunately RStudio doesn't have this feature. You can request it by commenting/upvoting here:
However, a good workaround for now might be to have RStudio run code by "paragraphs" instead of statements (look under Options > Code > Execution). This will keep RStudio from having to understand the code to find statement boundaries; it will just run everything between blank lines, which might work for your purposes.
Ah okay thanks for the response! Was really scratching my head on this one. Off topic, but are there other IDEs that do this? I really haven't used much of anything outside of R and Stata, and thus it's really weird to me that this isn't base functionality. Not to be too critical because it's great that you can integrate Python code in Rmds, but it really slows down the workflow. I'll go share my thoughts there.