Skip to content

Latest commit

 

History

History
185 lines (185 loc) · 6.29 KB

rsconnect_test.md

File metadata and controls

185 lines (185 loc) · 6.29 KB

Linux:

]load /home/kimmo/rsconnect/rserve.dyalog
or
2 ⎕FIX 'file:///home/kimmo/rsconnect/rserve.dyalog'

Windows:

]load '/users/kimmo/onedrive/asiakirjat/github/rsconnect/rserve.dyalog'
or
2 ⎕FIX 'file:///users/kimmo/onedrive/asiakirjat/github/rsconnect/rserve.dyalog'

A test set:

r⎕new RS.Rserve
]boxing on
⎕ml1
r.eval '1+2'
r.eval 'c(1,2,3)*c(10,20,30)'
(r.eval 'matrix(1:12,3)').value
(r.eval 'matrix(1:12,3,byrow=TRUE)').value
110normAPLr.eval 'rnorm(1000,100,1)'
'normR' r.set normAPL
110r.eval 'normR'
(r.eval 'summary(normR)').value
x¯10 10 {[1]++\0,(|-/)÷} 50
zx.{{10×(1)÷}((*2)+*2)*.5}x
('x' 'z') r.set (x z)
expr'persp(x,x,z,theta=30,phi=30,expand=0.5,'
expr,'xlab="X",ylab="Y",zlab="Z")'
r.eval expr
r.eval 'graphics.off()'
co2r.eval 'co2'
co2.attributes[]
co2.attributes['class']
co2.attributes['tsp']  
co2.value[8;]
r.eval 'age <-18:20'
'height' r.set (76.1 77 78.1)
vr.eval 'village <-data.frame(age=age,height=height)'
v.attributes[]
v[;]
v.value
obj⎕new #.RS.robject
obj.attributes['tsp' 'class'](2014(2014+11÷12)12) 'ts'
obj.data?12100
'myts' r.set obj
(r.eval 'summary(myts)').value
mydf⎕new #.RS.robject
mydf.attributes['class' 'names']'data.frame' ('xx' 'square')
mydf.data[1]((12).*1 2)
'mydf' r.set mydf
(r.eval'summary(mydf)').value
ar.eval'iris'
'out' r.set a
a.value(r.eval 'out').value

Responses:

]boxing on
Was ON
⎕ml1
r.eval '1+2'
3
r.eval 'c(1,2,3)*c(10,20,30)'
10 40 90
(r.eval 'matrix(1:12,3)').value
1 4 7 10
2 5 8 11
3 6 9 12
(r.eval 'matrix(1:12,3,byrow=TRUE)').value
1  2  3  4
5  6  7  8
9 10 11 12
110normAPLr.eval 'rnorm(1000,100,1)'
 100.1 98.6 100.3 101.0 99.6 100.5 97.3 98.0 99.7 99.6
'normR' r.set normAPL
1
110r.eval 'normR'
 100.1 98.6 100.3 101.0 99.6 100.5 97.3 98.0 99.7 99.6
(r.eval 'summary(normR)').value
┌───────────┬───────────┬───────────┬──────────┬───────────┬───────────┐
│Min.1st Qu.MedianMean3rd Qu.Max.       │
├───────────┼───────────┼───────────┼──────────┼───────────┼───────────┤
│96.1694025799.30228086100.0571833100.032433100.7173424102.9860109│
└───────────┴───────────┴───────────┴──────────┴───────────┴───────────┘
x¯10 10 {[1]++\0,(|-/)÷} 50
zx.{{10×(1)÷}((*2)+*2)*.5}x
('x' 'z') r.set (x z)
1 1
expr'persp(x,x,z,theta=30,phi=30,expand=0.5,'
expr,'xlab="X",ylab="Y",zlab="Z")'
r.eval expr
#.[Rserve].[robject]
r.eval 'graphics.off()'
[Null]
co2r.eval 'co2'
co2.attributes[]
┌─────┬───┐
│classtsp│
└─────┴───┘
co2.attributes['class']
┌──┐
│ts│
└──┘
co2.attributes['tsp']  
┌───────────────────┐
│1959 1997.916667 12│
└───────────────────┘
co2.value[8;]
1959 1 315.42
1959 2 316.31
1959 3 316.5 
1959 4 317.56
1959 5 318.13
1959 6 318   
1959 7 316.39
1959 8 314.65
r.eval 'age <-18:20'
18 19 20
'height' r.set (76.1 77 78.1)
1
vr.eval 'village <-data.frame(age=age,height=height)'
v.attributes[]
┌─────┬─────┬─────────┐
│namesclassrow.names│
└─────┴─────┴─────────┘
v[;]
┌───┬──────┐
│ageheight│
├───┼──────┤
│1876.1  │
├───┼──────┤
│1977    │
├───┼──────┤
│2078.1  │
└───┴──────┘
v.value
┌───┬──────┐
│ageheight│
├───┼──────┤
│1876.1  │
├───┼──────┤
│1977    │
├───┼──────┤
│2078.1  │
└───┴──────┘
obj⎕new #.RS.robject
obj.attributes['tsp' 'class'](2014(2014+11÷12)12) 'ts'
obj.data?12100
'myts' r.set obj
1
(r.eval 'summary(myts)').value
┌────┬───────┬──────┬───────────┬───────┬────┐
│Min.1st Qu.MedianMean3rd Qu.Max.│
├────┼───────┼──────┼───────────┼───────┼────┤
│52450.548.5833333375.584  │
└────┴───────┴──────┴───────────┴───────┴────┘
mydf⎕new #.RS.robject
mydf.attributes['class' 'names']'data.frame' ('xx' 'square')
mydf.data[1]((12).*1 2)
'mydf' r.set mydf
1
(r.eval'summary(mydf)').value
┌───────────────┬────────────────┐
│      xxsquare      │
├───────────────┼────────────────┤
│Min.   : 1.00Min.   :  1.00  │
├───────────────┼────────────────┤
│1st Qu.: 3.751st Qu.: 14.25  │
├───────────────┼────────────────┤
│Median : 6.50Median : 42.50  │
├───────────────┼────────────────┤
│Mean   : 6.50Mean   : 54.17  │
├───────────────┼────────────────┤
│3rd Qu.: 9.253rd Qu.: 85.75  │
├───────────────┼────────────────┤
│Max.   :12.00Max.   :144.00  │
└───────────────┴────────────────┘
ar.eval'iris'
'out' r.set a
1
a.value(r.eval 'out').value
1