-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathweekday-counter.R
More file actions
17 lines (14 loc) · 843 Bytes
/
weekday-counter.R
File metadata and controls
17 lines (14 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
weekdaycounts<-data.frame( day = c(rep("Monday",times=10),
rep("Tuesday",times=10),
rep("Wednesday",times=10),
rep("Thursday",times=10),
rep("Friday",times=10),
rep("Saturday",times=10),
rep("Sunday",times=10)),
value = c(8,35,25,7,99,64,2,1,3,12, #10 manually-chosen random numbers
sample.int(60)) #60 more automatically generated random numbers
)
#how many times did the number 10 appear?
print(nrow(subset(weekdaycounts,subset=(value==10))))
#how many times did the number 1 appear?
print(nrow(subset(weekdaycounts,subset=(value==1))))