Professional Documents
Culture Documents
Converted R
Converted R
27*(38-17)
#b) ln(147)
log(14^7)
#c) 436/12
sqrt(436/12)
[1] 567
[1] 18.4734
[1] 6.027714
#Use vector arithmetic to multiply these vectors and call the result
d.
d= a * b
#What are all of the elements of d which are less than 2000?
d[d < 2000]
[1] 16
#sum of d
sum(d)
#median of d
median(d)
#standard deviation of d
sd(d)
[1] 175120
[1] 5897.5
[1] 2608.563
#1st matrix
a = c(7,9,12)
b= c(2,4,13)
X= rbind(a, b)
#2nd matrix
w= c(1,7,12,19)
z= c(2,8,13,20)
l= c(3,9,14,21)
Y= rbind(w, z, l)
#multiplication
X%*%Y
as.data.frame(X)
V1 V2 V3
a 7 9 12
b 2 4 13
3- Data exploration
2- Outliers, anomalies
4- Distribution of data
boxplot(Tasla$Open)
#plot(sort(.)) --> if i want to identify outerliers and distribution
of data.
plot(Open~Close, data= Tasla)
model <- lm(Open ~ Close, data = Tasla)
#Scatter plot used to compare the position of each data point to the
mean line
#Show how closely the data points cluster around the mean and identify
any outliers in the data.
plot(Open~Close, data= Tasla)
positive --> mean line were to take the same direction of the data points 📈
hexbinplot --> isualize the distribution and denisty of data at specific value of data points
pairs() --> to examine many two-way relationships, generate a plot of each pairs of variables