Skip to content

Function definition vector default parameter #337

Answered by bhaller
alxsimon asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! Yes, this is something you can do in R but not in Eidos. Default values have to be simple constants; they cannot involve calculations. So a call to c() is not allowed; even something like 5+5 is not allowed. Typically in this situation I make NULL be the default value for the parameter, and then check in the function's script for a NULL value and replace it with the desired default. Not great, but it works.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@alxsimon
Comment options

Answer selected by alxsimon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants