Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions task1.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This data show number of quakes greater than the magnitude 7 from 1900 to 2000. We hae slightly less number of powerful earhtqquakes nowadays.
quakes<-read.table("https://seattlecentral.edu/qelp/sets/039/s039.txt", sep="\t", header=T)
names(quakes) = c("years","earthquakes")
reg1 <- lm(years~earthquakes,data=quakes)
with(quakes,plot(years,earthquakes))
abline(reg1)
17 changes: 17 additions & 0 deletions task2.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
library(ggplot2)
data <- read.table(file = "data.txt", header = T, sep = ",", stringsAsFactors = FALSE)

ggplot(data, aes(x = region, y = observations)) +
stat_summary(fun = mean, geom = "bar") +
xlab(“region") +
ylab(“observations") +
theme_classic()

ggplot(data = data,aes(x = region, y = observations)) +
geom_point() +
geom_jitter()
xlab(“region") +
ylab(“observations") +
theme_classic()

# Barplot does not show us the great variance in diffrent regions here. SInce means are very similar we might be deceived. Jitterplot shows us the spread of clusters which gives us more information.