Description Usage Arguments Examples
View source: R/init_if_absent.R
Get a name (as "character"), checks if there is an object with that name exists, if it does it leaves the object untouched. If it does not exists, sets it to "value". Returns messages indicating what happened. If an object is given it checks the value inside the object and if it is "character" the function uses this string to name the object.
1 | init_if_absent(name, value)
|
name |
name to be used on object assignment. |
value |
value to give pass to the object. |
1 2 3 4 5 6 7 | init_if_absent("y", 1:10)
init_if_absent("y", 11:20) # repeating does not change its value
name <- "var1"
init_if_absent(name, 200:100)
var1
name
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.