NLDfToList: Transforms a data.frame into a NetLogo list or multiple...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/NLDfToList.R

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

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

Arguments

in.data.frame

The data.frame to fill the NetLogo lists.

nl.obj

(optional) A string identifying a reference to a NetLogo instance created with NLStart.

Details

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

Value

No return value.

Author(s)

Jan C. Thiele <rnetlogo@gmx.de>

See Also

NLDoCommand, NLDoCommandWhile, NLReport

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
NLStart("C:/Program Files/NetLogo 6.0/app")
df1 <- data.frame(x=c(1,2,3,4),y=c(5,6,7,8))
# the current NetLogo model must have two variables ('x' and 'y')
# add the variables
NLSourceFromString("globals [x y]", append.model=FALSE)
# set the variables to the data.frame
NLDfToList(df1)

## End(Not run)

RNetLogo documentation built on May 2, 2019, 9:29 a.m.