From 1046cd2ce44cc39761ee1e624d35ceb4a1651758 Mon Sep 17 00:00:00 2001 From: "M.Redondo" Date: Tue, 29 Oct 2024 17:00:25 +0100 Subject: [PATCH] updated loop slides --- slide_r_elements_4.Rmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slide_r_elements_4.Rmd b/slide_r_elements_4.Rmd index 355b925..5ef087b 100644 --- a/slide_r_elements_4.Rmd +++ b/slide_r_elements_4.Rmd @@ -84,7 +84,7 @@ Example. ```{r for.loop, echo=T} for (i in 1:5) { - cat(paste('Performing operation on no.', i), '\n') + print(paste('Performing operation on no.', i)) } ``` @@ -93,7 +93,7 @@ A slight modification of the above example. ```{r for.loop2, echo=T} for (i in c(2,4,6,8,10)) { - cat(paste('Performing operation on no.', i), '\n') + print(paste('Performing operation on no.', i)) } ``` The variable `i` takes values from the sequences.