-
Notifications
You must be signed in to change notification settings - Fork 1
/
tests-r.txt
84 lines (76 loc) · 2.58 KB
/
tests-r.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
SmokeTest
extensions [ r ]
r:get "1:3" => [1 2 3]
O> r:put "x" "hello!"
r:get "x" => "hello!"
Eval
extensions [ r ]
O> r:eval "x <- 100"
r:get "x" => 100
PutList
extensions [ r ]
O> r:putList "a" 10
r:get "a" => 10
r:get "class(a)" => "numeric"
O> (r:putList "a" 10 20 30)
r:get "a" => [10 20 30]
r:get "class(a)" => "numeric"
PutNamedList
extensions [ r ]
O> r:putNamedList "a" "x" 10
r:get "a" => [["x" 10]]
r:get "class(a)" => "numeric"
O> (r:putNamedList "a" "x" 10 "y" 20 "z" 30)
r:get "a" => [["x" 10] ["y" 20] ["z" 30]]
r:get "class(a)" => "numeric"
PutDataFrame
extensions [ r ]
O> r:putDataframe "a" "x" 10
r:runresult "a" => [["x" 10]]
r:get "class(a)" => "data.frame"
O> (r:putDataframe "a" "x" 10 "y" 20 "z" 30)
r:get "a" => [["x" 10] ["y" 20] ["z" 30]]
r:get "class(a)" => "data.frame"
O> (r:putDataframe "a" "x" [10 20 30] "y" ["f" "g" "h"] "z" [true false true])
r:get "a" => [["x" [10 20 30]] ["y" ["f" "g" "h"]] ["z" [true false true]]]
r:get "class(a)" => "data.frame"
PutAgent
extensions [ r ]
O> create-turtles 1 [ set color red set heading 90 set shape "arrow" ]
O> r:putAgent "a" (one-of turtles) "color"
r:get "a" => [["color" 15]]
r:get "class(a)" => "numeric"
O> (r:putAgent "a" (one-of turtles) "color" "heading" "shape")
r:get "a" => [["color" 15] ["heading" 90] ["shape" "arrow"]]
r:get "class(a)" => "list"
O> create-turtles 1 [ set color blue set heading 180 set shape "wolf" ]
O> r:putAgent "a" turtles "color"
r:get "a" => [["color" [15 105]]]
r:get "class(a)" => "list"
O> (r:putAgent "a" turtles "color" "heading" "shape")
r:get "a" => [["color" [15 105]] ["heading" [90 180]] ["shape" ["arrow" "wolf"]]]
r:get "class(a)" => "list"
PutAgentDataFrame
extensions [ r ]
O> create-turtles 1 [ set color red set heading 90 set shape "arrow" ]
O> r:putAgentDf "a" (one-of turtles) "color"
r:get "a" => [["color" 15]]
r:get "class(a)" => "data.frame"
O> (r:putAgentDf "a" (one-of turtles) "color" "heading" "shape")
r:get "a" => [["color" 15] ["heading" 90] ["shape" "arrow"]]
r:get "class(a)" => "data.frame"
O> create-turtles 1 [ set color blue set heading 180 set shape "wolf" ]
O> r:putAgentDf "a" turtles "color"
r:get "a" => [["color" [15 105]]]
r:get "class(a)" => "data.frame"
O> (r:putAgentDf "a" turtles "color" "heading" "shape")
r:get "a" => [["color" [15 105]] ["heading" [90 180]] ["shape" ["arrow" "wolf"]]]
r:get "class(a)" => "data.frame"
SetPlotDevice
extensions [ r ]
O> r:setPlotDevice
Unimplemented
extensions [ r ]
O> r:gc
O> r:stop
r:jri-path => ""