Thursday, March 8, 2007

testing testing

this is just a test to see what kind of HTML formatting blogger will allow you to use such that we can incorporate R code and output while preserving spacing for columns and the like (so it looks like the output on your R terminal).

for instance, compare this:

> head(iris)
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3.0 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1 1.5 0.2 setosa
5 5.0 3.6 1.4 0.2 setosa
6 5.4 3.9 1.7 0.4 setosa

with this:

> head(iris)
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1 5.1 3.5 1.4 0.2 setosa
2 4.9 3.0 1.4 0.2 setosa
3 4.7 3.2 1.3 0.2 setosa
4 4.6 3.1 1.5 0.2 setosa
5 5.0 3.6 1.4 0.2 setosa
6 5.4 3.9 1.7 0.4 setosa
>

the trick is to enclose the cut-and-pasted output from R in between the HTML markup tags <PRE> ... <\PRE>

4 comments:

Rebecca Hazen said...

Thanks, Mike!

megan said...

That will be useful! Out of curiosity, what does the "PRE" mean/stand for?

Mike said...

i think it stands for 'preformatted'.

http://www.w3schools.com/tags/tag_pre.asp

Anonymous said...

BAHAHAHAHAHAHAHA
fish sticks shaped like jane austen. i approve. oh, i approve.
you make my day.