This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install.packages("readxl") | |
# install.packages("clusteval") | |
install.packages("prabclus") | |
install.packages("vegan") | |
library(readxl) | |
# library(clusteval) | |
library(prabclus) | |
library(vegan) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ui <- fluidPage( | |
tags$head( | |
#Using ionRangeSlider's javascript options you can hide/show selector labels and min/max labels | |
HTML(" | |
<script> | |
$(document).ready(function(){ | |
$(\".js-range-slider\").ionRangeSlider({ | |
hide_min_max: false, | |
hide_from_to: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Rule 0: strings as factors!!! | |
options(stringsAsFactors=FALSE) | |
## To avoid quaint time zone issues, set to UTC if you are working on a single timezone | |
Sys.setenv(TZ="UTC") | |
## on_sys_locale_problems | |
sudo defaults write org.R-project.R force.LANG en_US.UTF-8 #Mac Terminal | |
Sys.setlocale("LC_ALL", 'en_US.UTF-8') #Linux R Console | |
Sys.setlocale(locale="Turkish_Turkey.1254") #Windows |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) | |
) |
OlderNewer