Description Usage Arguments Details Value Author(s) See Also Examples
forKeyVal loops a named list or vector, with one variable bound to the key and another to the value.
1 | forKeyVal(key,val,LIST,block,envir=parent.frame())
|
key |
the variable to be bound by the name of the element of the LIST |
val |
the variable to be bound by the value of the element of the LIST |
LIST |
a list |
block |
the block to be exectued, with this variables bound |
envir |
the environment in which the variables are bound and the block is executed |
It works much like a for(val in LIST) block
with the
difference. It however additionally binds key to the value name of the
list element, but does not recognize continue or break
statements. This might change at some point in future.
Empty or unbound names result in a binding of key to NULL
.
the value of the last execution of the block
K. Gerald van den Boogaart
1 2 3 4 5 6 7 8 9 10 11 12 |
Loading required package: DBI
Loading required package: RMySQL
Loading required package: foreach
Loading required package: digest
Loading required package: shiny
gmDatabase: Working with geometallurgical databases, Version: 0.5.0
a => 1
b => 5
c => 6
a
a.1=>4
b
b.1=>1
b.2=>2
b.3=>3
b.4=>4
b.5=>5
b.6=>6
b.7=>7
c
c.a=>Aber
c.b=>nicht
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.