Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
3.6 kB
1
Indexable
Never
print("the world is yours")
help(sum)
example("for")
emre<- c(1, 2, 3, 4, 5)
sum(1,2,3)
getwd<- c("C:/Users/emre/desktop")
setwd<- c("C:/Users/emre/desktop")
history<- c("inf")
.Last.value<- c(1, 3, 5)
.Last.value
data<- c("mtcars")
ls<- c("objects")
rm<- c(2001)
install.packages("splines")
library("grid")
library<- c("splines")
view<- c("mtcars")
emre <- c("a", "b", "c", "d")
str<- c("emre")
data<- c("mtcars")
summary<- c("mtcars")

vektör_1 <- c(1, 2, 3, 4, 5)

vektör_2 <- c("Yaşar", "Emre", "GÜNEŞ")

vektör_3 <- c(TRUE, FALSE, TRUE)

vektör_4 <- c(1 + 2i, 3 + 4i, 5 + 6i)

x <- c(1, 2, 3)
y <- c(4, 5, 6)
z <- x + y

print(vektör_2[2])

plakakod <- c(27,34,35)
names(plakakod) <- c("Gaziantep","İstanbul","İzmir")
print(plakakod)

v1 = c(1,2,3)
v2 = c(-2,2,0)
v1<v2
v2==v1
v1>v2


a=c(1,2,4)
b=c(2,6,9)
c=c(4,0,3)
any(a==b)
any(a<b)
any(c!=a)

vektör_örn= c(1,2,4,6,5,8,7,9,32,4,7,457,8,9,236)
print(vektör_örn[7])

vektör_örn+3 

a_1 = c(1,2)
a_1=c(a_1,3)
print(a_1)


ardisik = 1:21
print(ardisik)

ardisik_harf = letters[2:17]
print(ardisik_harf)


for (emre in 1:10) {
  print(emre)
}
real_world = 1

while (real_world <= 10) {
  print(real_world)
    real_world <- real_world + 1
}
v <- c(2, 4, 6, 8, 10)
if (v[1] == 4) {
  print("ilk eleman 4'e eşit")
} else {
  print("ilk eleman 4'e eşit değil")
}

liste=list(1,2,3,4)
names(liste)=c("emre","ayaz","yaşar")
liste[["emre"]]


a1 ="emre"
a2 =2
a3=list("yasar","emre")
a4=c(1,2,3,4,5)
a5=c("deneme","yazısı")
mode(a1)
mode(a2)
mode(a3)
mode(a4)
mode(a5)



matrik = matrix(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), nrow = 5, ncol = 2)
print(matrik)

matrik_1 = matrix(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), nrow = 5, ncol = 2, byrow =F)
print(matrik_1)
dim(matrik_1)

vectör_a1 = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
matrik_a1 = matrix(vectör_a1, nrow = 3, ncol = 4)

matrik_1 = matrix(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), nrow = 5, ncol = 2, byrow =F)
trans_matrik <- t(matrik_1)
print(trans_matrik)

data("mtcars")
car_names <- mtcars$rownames
disp_hp <- mtcars[,c("disp", "hp")]
disp_mean <- mean(mtcars$disp)


markalar = c("bmw", "mercedes", "bugatti", "mclaren")

markalar_factor = factor(markalar)
print(markalar_factor)

mean(mtcars$disp)
median(mtcars$disp)
sd(mtcars$disp) 
summary(mtcars$disp)

marka = c("bmw", "audi", "mclaren")
yıl = c(2023, 2014, 2020)
model = c("320i", "a4", "302mc")

marka_modeli = data.frame(marka, yıl, model)
print(marka_modeli)

colnames(marka_modeli)=c("markaad", "yapımyılı", "modeli")
colnames(marka_modeli)

print(model[2:3])
print(yıl[c(1,3)])

df1_ornek <- data.frame(marka = c("bmw", "audi", "mclaren"), yıl = c(2023, 2014, 2020), model = c("320i", "a4", "302mc"))


df2_ornek <- data.frame(marka= c("mercedes", "toyota", "hundai"), yıl = c(2000, 2007, 2009), model = c("G", "corola", "i30"))


bilersik = rbind(df1_ornek, df2_ornek)


birles <- cbind(df1_ornek, fiyatlar = c(50000, 60000, 70000))

df2_ornek <- data.frame(marka= c("mercedes", "toyota", "hundai"), yıl = c(2000, 2007, 2009), model = c("G", "corola", "i30"))
yeni_satır <- data.frame(marka = "gtr", yıl = 2001, model = "R")
new_df <- rbind(df2_ornek, yeni_satır)
print(new_df)

mean(mtcars$hp) 
median(mtcars$hp)
sd(mtcars$hp)
summary(mtcars$hp)
library(psych)
describe(mtcars)

data(mtcars)

dim(mtcars)


head(mtcars)


tail(mtcars)

colnames(mtcars)

summary(mtcars$hp)


install.packages("ggplot2")
library(ggplot2)

ggplot(mtcars, aes(x = mpg, y = cyl)) + 
  geom_point()

write.csv(mtcars, file = "mtcars.csv")
#install.packages("writexl")
library(writexl)
write_xlsx(mtcars, "mtcars.xlsx")