Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display functions like '+' or '[' as is

Tags:

r

knitr

When I write code chunk in Rmd-file

```{r}
'+'(3,5)
```

knitr returns html-file as

3 + 5

So it transforms the expression to more common format. How can I disable such transformation to keep expression as is?
In comparison, the same code in Rpres-file is displayed correctly '+'(3,5).

like image 399
DrDom Avatar asked Apr 20 '14 03:04

DrDom


People also ask

What is like %% in SQL?

The LIKE operator is used in a WHERE clause to search for a specified pattern in a column. There are two wildcards often used in conjunction with the LIKE operator: The percent sign (%) represents zero, one, or multiple characters. The underscore sign (_) represents one, single character.

How do you show a function?

The notation y=f(x) defines a function named f. This is read as “y is a function of x.” The letter x represents the input value, or independent variable. The letter y, or f(x), represents the output value, or dependent variable.

What is as function in SQL?

The AS command is used to rename a column or table with an alias. An alias only exists for the duration of the query.


1 Answers

All the credit goes to @rawr, and his comment of "set tidy = FALSE".

This question needed an answer.

```{r, tidy=FALSE}
'+'(3, 5)
```

produces enter image description here

like image 87
Rich Scriven Avatar answered Sep 18 '22 17:09

Rich Scriven