From 0fad6571556fb4c701e69b9c6d1c4b4ebd29970a Mon Sep 17 00:00:00 2001 From: dc230e4232c633941d7b74c8cce89395 Date: Mon, 23 Aug 2021 13:17:51 +0000 Subject: [PATCH] Adding r command to last chunk of code --- module2/exo1/toy_document_en.Rmd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module2/exo1/toy_document_en.Rmd b/module2/exo1/toy_document_en.Rmd index 9e7dda0..c121e13 100644 --- a/module2/exo1/toy_document_en.Rmd +++ b/module2/exo1/toy_document_en.Rmd @@ -41,8 +41,9 @@ df$Accept = (df$X**2 + df$Y**2 <=1) library(ggplot2) ggplot(df, aes(x=X,y=Y,color=Accept)) + geom_point(alpha=.2) + coord_fixed() + theme_bw() ``` -It is then straightforward to obtain a (not really good) approximation to $\pi$ by counting how many times, on average, $\X^2 + Y^2$ is smaller than 1 : +It is then straightforward to obtain a (not really good) approximation to $\pi$ by counting how many times, on average, $X^2 + Y^2$ is smaller than 1 : -```4*mean(df$Accept) +```{r} +4*mean(df$Accept) ``` -- 2.18.1