-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththe_shell.txt
More file actions
32 lines (23 loc) · 1.25 KB
/
the_shell.txt
File metadata and controls
32 lines (23 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- in an *`R` console*, all commands that you input are interpreted by the program "`R`". E.g. the command `Sys.time()` is an `R` command, and if you type it into the `R`-console it returns today's date and time.
- in a *terminal console* you usually specify a program to interpret your command. You can run the **`R`** Command `Sys.time()` from the shell in the following way: `Rscript -e "Sys.time()"`.
```{r, results="asis", echo = FALSE, message=FALSE, warning = FALSE}
library(tidyverse)
library(glue)
tab <- tribble(
~command, ~desc,
"Rscript", "refers to *the programm* you want to use, which is an executable located somewhere on your computer",
"-e", "is *an argument* (which specifies that we want to run a single line of `R`-Code)",
"'Sys.time()'", "is the *value* to the argument, in this case the command that we want to run",
) %>%
mutate(col = RColorBrewer::brewer.pal(nrow(.), "Set1"))
pmap_chr(tab, function(command, desc,col){
glue( "<span style='color:{col}'>{command} </span>")
}) %>%
paste(collapse = "")%>%
paste("<code>",.,"</code>") %>%
pander::pandoc.p()
pmap_chr(tab, function(command, desc,col){
glue("<code style='color:{col};'>{command} </code> <span style = 'color: {col}'>{desc}</span>")
}) %>%
pander::pandoc.list()
```