Post on 05-Aug-2019
R GUI
Zulhanif
RGUI
Dalam teknologi komputasi, antarmuka
pengguna grafis atau APG (Inggris: Graphical
User Interface atau GUI) adalah jenisa
ntarmuka pengguna yang menggunakanntarmuka pengguna yang menggunakan
metoda interaksi pada piranti elektronik
secara grafis (bukan perintah teks) antara
pengguna dan komputer.(sumber:
http://id.wikipedia.org/.
Contoh
Function
myfct <- function(arg1, arg2, ...)
{
function_body
}}
Fgui
library(fgui)
tambah=function(a,b){
hasil=a+b
return(hasil)return(hasil)
}
gui(tambah)
Contoh
• pilihan=function (Ket) {
• if (Ket){
• pesan="stat"
• return(pesan)
• } else {• } else {
• pesan="statistika"
• return(pesan)
• }
• }
• res=gui(pilihan,argOption=list(Ket=c("TRUE","FALSE")))
Latihan
• Buat GUI untuk menghitung Rata-rata,Median
dan SD
Latihan
library(fgui)
samplesize=function (alpha, p0, e,N) {
n1=(qnorm(1-alpha/2)*sqrt(p0*(1-p0))/e)^2
n=n1/(1+((n1-1)/N))n=n1/(1+((n1-1)/N))
return(n)
}
res=gui(samplesize)
Zulhanif
BERT
“BERT adalah alat yang menghubungkan Excel
dengan Software R”
Download paket https://bert-toolkit.com/Download paket https://bert-toolkit.com/
Yang sudah didownload ambil di mas agus
System Requirements
• Windows Vista, 7, 8 atau 10 dengan Excel
2007, 2010, 2013 or 2016. 32- dan 64-bit
• No Excel 2003 and
• No Mac, sorry. • No Mac, sorry.
ARSITEKTUR
EXCEL R
BERT
Skill Need
• R
• Excel
• VBA Excel
Interface
Call Excel From R
Contoh 1
My Function…………..
function
My Function
Tambah=function(a,b){
h=a+b
return(h)
}}
1. Tambahkan kode ini di function.r pakenotepad
2. Reload Startup file
Hasil lihat di sheet excel
Call From R to Excel
GUI
• VBA
• ALT+F11
BERT$AddUserButton( "Histogram", function(){
Selection <- as.numeric( Get.Selection());
if( length( Selection ) > 2 ){ hist( Selection ); } });
Form