Skip to content

Instantly share code, notes, and snippets.

View berkorbay's full-sized avatar
🏄

Berk Orbay berkorbay

🏄
  • Tideseed
  • Istanbul, Turkey
  • 13:03 (UTC +03:00)
View GitHub Profile
#Akademik Bilişim 2016 - R ile Veri Analizi Kursu
#Eğitmenler: Mustafa Baydoğan ve Berk Orbay
#dplyr ve ggplot2 örnekleri
#Aşağıdaki satırları anlamanız önemli değil
rm(list=ls(all=TRUE)) #Ortamda bulunan bütün değişkenleri yok et.
gc() #Hafızayı temizle (garbage collection)
options(stringsAsFactors=FALSE) #data.frame yapısında characterleri factor değil character şeklinde tanımla
options(repos="https://cran.rstudio.com/") #R paketlerini indirirken bu depoyu kullan
#library(dplyr)
library(ggplot2)
#mydata<-read.table("~/Downloads/bcom.csv",sep=",",header=TRUE) %>% tbl_df
#md2<-mydata %>% mutate(Date=as.Date(as.character(Date),format="%b %d,%Y"))
#ggplot(md2,aes(x=Date,y=Price)) + geom_line()
###Data frame versiyonu
mydata<-read.table("~/Downloads/bcom.csv",sep=",",header=TRUE)
@berkorbay
berkorbay / jaccard_examples.r
Created September 28, 2016 13:48
Jaccard distance
install.packages("readxl")
# install.packages("clusteval")
install.packages("prabclus")
install.packages("vegan")
library(readxl)
# library(clusteval)
library(prabclus)
library(vegan)
@berkorbay
berkorbay / first_time_use_learnfin.r
Last active November 8, 2016 09:43
These gists are specially created to initialize uslfin users.
#Part of the learnfin package tutorial.
#First set of experiments with (almost) default values.
####REQUIRED - CHANGE BELOW
setwd("Set this value to the path of the input parameters excel file.")
##Example MacOS, Linux setwd("~/Documents/learnfin_implementation/")
##Example Windows setwd("C:/Documents/learnfin_implementation/")
#The code below will do a series of experiments and return the summary results of those experiments.
#Experiment parameters are taken from the input_parameters.xlsx file.
@berkorbay
berkorbay / r_ifttt_notification.r
Last active January 5, 2017 13:07
R ve IFTTT ile Notificaton Atmak
#R ile cep telefonuna notification gönderme kodu
#Detaylar için adresindeki yazıyı okuyun.
#httr paketi gerekli. Yuklemediyseniz yükleyin.
#install.packages("httr")
#Event adini girin.
event_name <- "R_ile_notification"
#Key değerini girin (kendinizinkiyle değiştirin)
@berkorbay
berkorbay / example_model_with_CART.R
Created April 12, 2017 07:14
This is an example code for BOUN58D project.
#Get the required libraries, install first if not installed.
options(dplyr.width=Inf)
library(boun58d) #Copy paste the necessary function if you cannot install this from github
library(tidyverse)
library(tidyquant)
library(rpart)
library(rpart.plot)
library(rattle)
set.seed(58) #Don't forget to set the seed for reproducibility
#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
@berkorbay
berkorbay / ab2018_gerekli_paketler.R
Last active January 29, 2018 08:30
Akademik Bilişim 2018 için gerekli paketler
#Customer Survey Data
survey_data <- data.frame(
customer = 1:16,
OS = c(0,0,0,0,1,0,0,0,1,1,0,1,1,1,1,1),
Price = c(6,7,6,5,7,6,5,6,3,1,2,5,2,3,1,2),
Software = c(5,3,4,7,7,4,7,5,5,3,6,7,4,5,6,3),
Aesthetics = c(3,2,4,1,5,2,2,4,6,7,6,7,5,6,5,7),
Brand = c(4,2,5,3,5,3,1,4,7,5,7,6,6,5,5,7)
)
@berkorbay
berkorbay / terminal_commands.txt
Last active May 3, 2018 11:04
Some terminal commands
sudo apt-get -y update && sudo apt-get -y upgrade
sudo echo "deb http://cran.rstudio.com/bin/linux/ubuntu xenial/" | sudo tee -a /etc/apt/sources.list
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
gpg -a --export E084DAB9 | sudo apt-key add -
sudo apt-get -y update
sudo apt-get -y install r-base
sudo apt-get -y install libcurl4-openssl-dev libssl-dev libxml2-dev
@berkorbay
berkorbay / shinyproxy_steps.txt
Last active May 3, 2018 13:25
shinyproxy steps
#See https://www.shinyproxy.io/getting-started/
sudo nano /lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd -H fd:// -D -H tcp://127.0.0.1:2375
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo docker pull openanalytics/shinyproxy-demo