catppuccin/samples/r.r
2023-10-21 12:05:37 +02:00

21 lines
No EOL
452 B
R
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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])