mirror of
https://github.com/catppuccin/catppuccin
synced 2024-11-13 23:37:07 +00:00
21 lines
452 B
R
21 lines
452 B
R
|
# function declaration
|
|||
|
global_function <- function(regular, named = "Hello World!") {
|
|||
|
# inner function declaration
|
|||
|
inner_function <- function() {
|
|||
|
closure_usage <- regular
|
|||
|
closure_usage + 1
|
|||
|
}
|
|||
|
|
|||
|
print(named)
|
|||
|
regular + inner_function()
|
|||
|
}
|
|||
|
|
|||
|
# function call
|
|||
|
global_function(2, named = 'Hello World!')
|
|||
|
|
|||
|
cat = list(name = "Smudge", breed = "Maine Coon")
|
|||
|
#variable acсess
|
|||
|
print(cat$breed)
|
|||
|
|
|||
|
# namespace access
|
|||
|
print(datasets::cars[1, 2])
|