Learn R Programming

RNetLogo (version 0.9.4)

NLDfToList: Transforms a data.frame into a NetLogo list or multiple NetLogo list (one for each column of the data.frame).

Description

NLDfToList pushes the values of a data.frame into NetLogo lists. The column names of the data.frame are used as names for the NetLogo lists (but the lists must already exist in the current NetLogo model).

Usage

NLDfToList(in.data.frame, nl.obj=NULL)

Arguments

in.data.frame
The data.frame to fill the NetLogo lists.
nl.obj
(optional) A reference to a NetLogo instance created with NLStart.

Value

  • No return value.

Details

Remember: There must be lists in the NetLogo model with the names of the columns of the submitted data.frame.

See Also

NLDoCommand, NLDoCommandWhile, NLReport

Examples

Run this code
NLStart("C:/Program Files/NetLogo 5.0.3")
df1 <- data.frame(x=c(1,2,3,4),y=c(1,2,3,4))
# the current NetLogo model must have lists with the names 'x' and 'y'
NLDfToList(df1)

Run the code above in your browser using DataLab