") Output i get [1]

instead, you can only get

...">

How to hide [1] in print () in R

When I use (in R)

print("<br><br>") 

Output i get

[1] <br><br>

instead, you can only get

<br><br>

I want to insert above into an HTML document.

+4
source share
2 answers

As Backlin mentioned, catwill hide [1].

Another useful feature that may lie (at least if you come from the background of the C family),

printf <- function (...) {
    invisible(cat(sprintf(...)))
}

See more details ?sprintf.

+1
source

Another solution is to use message(). Example (interpreter R):

> message('<br><br>')
<br><br>
+1
source

Source: https://habr.com/ru/post/1589204/


All Articles