2016-04-14 3 views
0

Ist es möglich, R-Code oder Variablenwerte in R-Abschriften zu interpolieren? Ich meine etwas wie:So interpolieren Sie variable Werte in R-Abschriften-Dokumenten

--- 
title: "Behavioural report" 
author: "My name" 
date: "Some date here" 
output: pdf_document 
--- 

```{r echo=FALSE} 
X = 1.28473 
``` 

Suppose that this is my R markdown document and I want to say that the value 
of the variable X = {Here I want the value of X to appear}. And then blah... 

So möchte ich den Wert 1.28473 direkt nach dem Text 'X =' erscheinen.

Vielen Dank im Voraus!

Antwort

1

Versuchen Sie Folgendes anstelle Ihres {}

`r X` 

Sie können auch tun Inline-Berechnungen verwenden:

`r mean(rnorm(50))` 
+0

Great !! Danke vielmals!! – user2641103