Created
April 15, 2015 06:32
-
-
Save aammd/7f4825b686b2e50435a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print_num <- function(num){ | |
print(num) | |
} | |
print_num_x <- function(num = x){ | |
print(num) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sources: | |
- rando.R | |
targets: | |
all: | |
depends: | |
- randum_num.md | |
x: | |
command: assign(I("x"), 42) | |
randum_num.md: | |
depends: x | |
knitr: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r, eval=FALSE} | |
source("rando.R") | |
x <- 42 | |
``` | |
i like numbers. `r print_num(5)` is a number | |
another number i like is `r x`. | |
Here is another number: `r print_num(x)` | |
That works fine. the object `x` is available within inline code chunks. | |
What happens if it is set as a default arguement? | |
in a code chunk | |
```{r} | |
print_num_x() | |
``` | |
the same is true for an inline code, but why break something twice? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment