Learn R Programming

RNetLogo (version 0.9.2)

NLCommand: Executes a command in the referenced NetLogo instance.

Description

NLCommand function is used to execute a NetLogo command (submitted as a string) in the submitted NetLogo instance.

Usage

NLCommand(..., nl.obj=NULL)

Arguments

...
An undefined number of strings with the NetLogo command(s) to be executed. Vectors, lists and data.frames will be represented as NetLogo-Lists. To set a NetLogo-List you can write 'set mylist',c(1,2,3) if the current NetLogo model kno
nl.obj
(optional) A variable holding a reference to a NetLogo instance created with NLStart.

Value

  • No return value.

Details

The command could be everything which can be submitted from the NetLogo Command Center. A command has no return value! If you want to return a value from NetLogo use NLReport and friends.

See Also

NLDoCommand, NLDoCommandWhile, NLReport

Examples

Run this code
NLStart("C:/Program Files/NetLogo 4.1.3")
NLCommand("create-turtles 10")

Run the code above in your browser using DataLab