FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
rcaller/RCaller/src/main/java/examples/BasicGraphics.java at master · jbytecode/rcaller · GitHub
jbytecode
/
rcaller
Public
Notifications
You must be signed in to change notification settings
Fork
39
Star
79
Code
Issues
5
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
rcaller
/
RCaller
/
src
/
main
/
java
/
examples
/
BasicGraphics.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
48 lines (38 loc) · 1.12 KB
Breadcrumbs
rcaller
/
RCaller
/
src
/
main
/
java
/
examples
/
BasicGraphics.java
Copy path
File metadata and controls
48 lines (38 loc) · 1.12 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
package
examples
;
import
com
.
github
.
rcaller
.
graphics
.
SkyTheme
;
import
com
.
github
.
rcaller
.
rstuff
.
RCaller
;
import
com
.
github
.
rcaller
.
rstuff
.
RCode
;
import
java
.
io
.
File
;
import
java
.
util
.
logging
.
Level
;
import
java
.
util
.
logging
.
Logger
;
/**
*
* @author Mehmet Hakan Satman
*
*/
public
class
BasicGraphics
{
public
BasicGraphics
() {
try
{
RCaller
caller
=
RCaller
.
create
();
RCode
code
=
RCode
.
create
();
code
.
addRCode
(
"x <- rnorm(30)"
);
code
.
addRCode
(
"y <- rnorm(30)"
);
code
.
addRCode
(
"ols <- lm(y~x)"
);
caller
.
setGraphicsTheme
(
new
SkyTheme
());
File
plt
=
code
.
startPlot
();
code
.
addRCode
(
"barplot(x,y)"
);
code
.
addRCode
(
"abline(ols$coefficients[1], ols$coefficients[2])"
);
code
.
addRCode
(
"abline(mean(y), 0)"
);
code
.
addRCode
(
"abline(v = mean(x))"
);
code
.
endPlot
();
caller
.
setRCode
(
code
);
caller
.
runAndReturnResult
(
"ols"
);
code
.
showPlot
(
plt
);
}
catch
(
Exception
e
) {
Logger
.
getLogger
(
BasicGraphics
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
e
.
getMessage
());
}
}
public
static
void
main
(
String
[]
args
) {
new
BasicGraphics
();
}
}
Back
|
FazBrowse Home
|
New Git URL