How do I run code in a note?
Set a code block to Python · runnable or R · runnable, then click Run cell.
- Add a code block: type
/codeand choose Code block. - In Edit mode, click the language label at the block's top right. It reads Plain at first. Choose Python · runnable or R · runnable.
- Write your code and click Run cell. The output appears under the code.
Shortcut: none
Good to know
- Terra runs code with the Python or R on your Mac. Python needs
ipykernel, and R needsIRkernel. - Stop cell, Restart kernel and Clear output sit beside Run cell.
- Code in a note that came from outside your library waits until you click Enable execution. That lasts until you quit.
- After a relaunch, old output is marked stale until you run the cell again.