/usr/lib/R/site-library/brew/catprint.brew is in r-cran-brew 1.0-6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | DATA FRAME OUTPUT (LISTS TOO)
Let's run this: <%% data(iris) %%>
<% data(iris) %>
Let's look at some R output:
If we say this: <%% head(iris) %%>
the output is this:
<% head(iris) %>
nothing right?
if we say this: <%%= head(iris) %%>
it's an error because cat() cannot handle lists.
But if we say this: <%% print(head(iris)) %%>
the output is this:
<% print(head(iris)) %>
VECTOR OUTPUT
We'll work with v: <%% v <- head(iris)$Sepal.Length %%>
<% v <- head(iris)$Sepal.Length %>
If we say this: <%%= v %%>
the output is this:
<%= v %>
because 'cat()' coerces v to a character vector
How about <%%= v > 5 %%>
<%= v > 5 %>
So cat() can deal with any vector
And if we say this: <%% print(v) %%>
the output is:
<% print(v) %>
|