Add inline code (#28019)

* Inline code

Add `arg()` inline code;
Minor spelling fix

* fix: removed extra frontmatter character
This commit is contained in:
Shen Lim
2019-02-09 17:55:37 -06:00
committed by Christopher McCormack
parent 2e11dcb1ea
commit 202ca8efc2

View File

@ -6,7 +6,7 @@ A function allows you to define a reusable block of code that can be executed ma
Functions can be named and called repeatedly or can be run anonymously in place (similar to lambda functions in python). Functions can be named and called repeatedly or can be run anonymously in place (similar to lambda functions in python).
Developing full understanding of R functions requires understanding of environments. Developing a full understanding of R functions requires understanding of environments.
Environments are simply a way to manage objects. An example of environments in action is that you can use a redundant variable Environments are simply a way to manage objects. An example of environments in action is that you can use a redundant variable
name within a function, that won't be affected if the larger runtime already has the same variable. Additionally, if a name within a function, that won't be affected if the larger runtime already has the same variable. Additionally, if a
function calls a variable which is not defined within the function, it will check the higher level environment for that variable. function calls a variable which is not defined within the function, it will check the higher level environment for that variable.
@ -169,15 +169,15 @@ its factorial with the `factorial()`.
[1] 6 [1] 6
``` ```
- If youre not sure which names to use with a function, you can look up the functions - If youre not sure which names to use with a function, you can look up the functions
arguments with args. arguments with `args()`. For example:
```r ```r
> args(round) > args(round)
[1] function(x, digits=0) [1] function(x, digits=0)
``` ```
## Resources ## Additional Resources
- [Official Docs](https://cran.r-project.org/manuals.html)
* [Official Docs](https://cran.r-project.org/manuals.html) - [Quick-R](https://www.statmethods.net/management/functions.html)
* [Quick-R](https://www.statmethods.net/management/functions.html) - [Advanced R: Functions](http://adv-r.had.co.nz/Functions.html)
* [Advanced R: Functions](http://adv-r.had.co.nz/Functions.html) - [CRAN](https://cran.r-project.org/doc/manuals/r-release/R-lang.html#Functions)