What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 150 Stack Exchange communities.

Possible Duplicate:
How do I format my code blocks?

I see everybody on this website posting their R outputs from the R console into the question boxes into a nice neat format. How can I do the same?

Basically I want to show in a question box exactly what I see in my R studio console. Copy paste does not work because the rows link together.

share|improve this question

migrated from stackoverflow.com Nov 19 '12 at 18:06

This question came from our site for professional and enthusiast programmers.

marked as duplicate by John, Toon Krijthe, animuson, yoozer8, Robert Harvey Nov 19 '12 at 20:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Also note that a copy/paste of the results of dput(object) will let someone paste your object into their R console, which is very useful for sharing a test object. (See stackoverflow.com/q/5963269/903061) – Gregor Nov 19 '12 at 18:09
And after dput, the very useful CTRL-K to format what you pasted into the Stack* page. – Carl Witthoft Nov 19 '12 at 20:01

1 Answer 1

Try the FAQ and study the formatting bar on top of the box. The two curly braces are formatted code and four indents do the same.

share|improve this answer
Also (though perhaps not directly an answer to the question) if you need to have code within some text, you can enclose it in backquotes (` `) giving code formatting : carfit <- lm(dist~speed, data = cars) - which is sometimes convenient. – Glen_b Nov 19 '12 at 19:59