I'm used to separating my code in different files, and call those files when needed. I did not manage to call a notebook (.Rmd) with chunks using the source() function.
I can source a notebook, but it will run as a script (.R), working well for functions written as:
test <- table(mydata$M1, mydata$M2FR)
test
but returning errors (attempt to use zero-length variable name
) for chunks as:
```{r}
test <- table(mydata$M1, mydata$M2FR)
test
```
Is there a way to use source() on a notebook with chunks, or should I design my files without chunks?