Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kode evalueringsfejl i 01-intor-to-r #46

Open
enerammer opened this issue Jan 15, 2024 · 2 comments
Open

Kode evalueringsfejl i 01-intor-to-r #46

enerammer opened this issue Jan 15, 2024 · 2 comments
Assignees

Comments

@enerammer
Copy link
Collaborator

Der står
function (x, digits = 0)
NULL

@chrbknudsen
Copy link
Contributor

Nope. Det er ikke en fejl. Det er outputtet af args(), jf dokumentationen:

Value
For a closure, a closure with identical formal argument list but an empty (NULL) body.

For a primitive (function), a closure with the documented usage and NULL body. Note that some primitives do not make use of named arguments and match by position rather than name.

NULL in case of a non-function.

Og det bliver jeg ikke supermeget klogere af hvis jeg skal være ærlig...
Men jeg tror (understreger tror) at vi skal forstå det som, at når vi har defineret en funktion:
min_funktion <- function(x, parameter = 47){
x*parameter
}

Så er resultatet af args(min_funktion) :
function(x, parameter = 47)

Og NULL står så i stedet for:
{
x*parameter
}

@chrbknudsen
Copy link
Contributor

Bør der være en omtale af NULL?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants