-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sessions Duration -Mean & Median.R
46 lines (27 loc) · 1.1 KB
/
Sessions Duration -Mean & Median.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Read the csv file
SessionsDurations <- read.csv(file = "SessionsDurations.csv", head = TRUE, sep = ",")
# Obtain the session durations above 1 minute
Duration <- subset(SessionsDurations[,4], SessionsDurations[,4] > 1)
# Obtain the mean and the median (exclude NA results)
median(Duration,na.rm = TRUE)
mean(Duration,na.rm = TRUE)
## Events per Day
# Read the csv file
EventsByDay <- read.csv(file = "EventsByDay.csv", head = TRUE, sep = ";")
# Obtain the number of sessions per day and player
EventsPerDay <- EventsByDay$Events
# Obtain the mean and the median (exclude NA results)
median(EventsPerDay,na.rm = TRUE)
mean(EventsPerDay,na.rm = TRUE)
#Create a box plot
boxplot(EventsPerDay,data=EventsByDay, xlab="Players", ylab="Events")
# Read the csv file
DaysHeld <- read.csv(file = "DaysHeld.csv", head = TRUE, sep = ";")
head(DaysHeld)
# Obtain the session durations above 1 minute
Days <- DaysHeld$Days
# Obtain the mean and the median (exclude NA results)
median(Days,na.rm = TRUE)
mean(Days,na.rm = TRUE)
#Create a box plot
boxplot(Days,data=DaysHeld, xlab="Players", ylab="Days Held")