Knitting bash code

Okay. I tried the following:

---
title: "R Notebook"
output: html_notebook
---
  
some text

```{r}
a <- runif(n = 10)
write.csv(x = a,
          file = "temp1.csv")
```

some text

```{r}
b <- rnorm(n = 10)
write.csv(x = b,
          file = "temp2.csv")
```

some text

```{bash}
cat temp1.csv temp2.csv > temp.csv
```

some text

```{r}
read.csv(file = "temp.csv")
```

some text

This gave me this .nb.html file:

Do you expect some other output?

As said earlier, I've no experience on bash, and hence I'll refrain myself from providing answers based on guesses. I'm sure other people on this community will help you in this problem. Meanwhile, please provide a REPRoducible EXample of your problem for them to help you.

1 Like