You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Well, a pure function is such a function which does not have any side effects and for any input it always returns the same output. For example, a mathematical function such as f(x) = x^2 is pure. However, function f(x) = sample(1:10, x) isn't pure because it returns different random values for the same input. Also a function f(x) = print(x) isn't pure because it causes a side effect (printing to console).
Pure functions behave nicely, they can be easily tested and reason about.
corrplot/R/corrplot.R
Lines 1047 to 1067 in 430e501
If these functions are drawing something, this means they cannot be pure because they have a side effect.
The text was updated successfully, but these errors were encountered: