Master
StoreNumber Online Pressure MON TUE WED ... SUN ...
1 0.2 50 0 0 0 ... 0
2 0.8 20 0 0 0 ... 0
3 1.2 10 0 0 0 ... 0
...
Hours
BranchNumber Day ... Time
1 MON 7.50
1 TUE 6.00
1 WED 8.50
3 MON 2.00
3 TUE 1.00
3 WED 2.50
...
NB There are many branch numbers about 10,500 due to being 7 days in a week so one branch number may occur 7 times for each day of the week, but some may only have 6 or 5 etc.
The idea is I want to populate the days of the week "Mon", "Tue", "Wed"... "Sun" etc in the 'Master' table from the 'Time' data in the 'Hours' Table. The match should check that the StorenNumber matches the BranchNumber...then the day of the week, if there is 'Mon' in the hours table then it should match it to the column 'Mon' in the Master table.
So the output will look something like this
StoreNumber Online Pressure MON TUE WED ... Hours
1 0.2 50 7.50 6.00 8.50 ... 53
2 0.8 20 0 0 0 ... 30
3 1.2 10 2.00 1.00 2.50 ... 20
...
As an example BranchNumber 2 doesnt exist in the Hours table so it should just skip each column and leaves the inputs as 0
I have tried the R based code below but am struggling to get an output...Once running the code I get zero errors but the Master Table remains unchanged and all days of the week columns remain as 0
merged <- Master%>% select(-
c("MON","TUE","WED","THU","FRI","SAT","SUN")) %>%
left_join(
Hours %>% pivot_wider(names_from = Day, values_from =
Time),
by = c("StoreNumber" = "BranchNumber"))
merged <- merged %>% replace(is.na(.),0)
Dput(Master)
Pressure = c(0, 0, 0, 0, 0, 0, 0, 0, 0.23, 0,
0.19, 0, 0, 0, 0.56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0.42, 0, 0, 0, 0, 0.37, 0, 0, 0.92, 0, 0, 0, 0,
0.04, 0.15, 0.12, 0.12, 0.06, 0.02, 0.19, 0.12, 0.08, 0.15,
0.02, 0.46, 0.25, 0.02, 0.17, 0.06, 0.25, 0.08, 0, 0.08,
0, 0.12, 0.23, 0.02, 0.04, 0.02, 0.15, 0, 0.02, 0.1, 0, 0,
0.04, 0.02, 0.23, 0.48, 0.19, 0.06, 0.02, 0.02, 0.08, 0.13,
0, 0.02, 0.08, 0.06, 0.15, 0.42, 0.06, 0.04, 0.04, 0.44,
0.06, 0.42, 0.06, 0.13, 0.46, 0, 0.81, 0.12, 0.25, 0.5, 0.06,
0.23, 0.02, 0.19, 0.33, 0, 0.06, 0.13, 0.12, 0.27, 0.04,
0.17, 0.13, 0.08, 0.12, 0.1, 0.21, 0.31, 0.17, 0, 0, 0.04,
0.1, 0.29, 0.13, 0.38, 0.15, 0.17, 0.58, 0.02, 0.02, 0.08,
1.15, 0.08, 0.1, 0.4, 0.58, 0.35, 0.12, 0.12, 0.5, 0.17,
0.6, 0.04, 0.06, 0.13, 0.12, 0.06, 0.19, 0.25, 0.06, 0.06,
0.1, 0, 0.29, 0.58, 0.02, 0.08, 1.4, 0.15, 0.21, 0.15, 0.1,
0.02, 0, 0, 0.08, 0, 0.02, 0.23, 0.1, 0.6, 0, 0.08, 0.37,
0, 0.17, 0.21, 0.44, 0.77, 0.33, 0.42, 0, 0.12, 0.12, 0.1,
0.12, 0.06, 0.02, 0.04, 0.17, 0.13, 0.02, 0.12, 0.25, 0.06,
0.04, 0.04, 0.17, 0.17, 0.6, 0.06, 0.37, 0, 0.15, 0.13, 0.08,
0.21, 0, 0.13, 0.02, 0.15, 0, 0.4, 0.23, 0.27, 0.08, 0.1,
0.19, 0.04, 0.02, 0.1, 0.17, 0.85, 0.56, 0, 0.56, 0.56, 0.06,
0.06, 0, 0.21, 0.02, 0.33, 0, 0.04, 0.13, 0.1, 0.12, 0, 0,
0.13, 0.17, 0.08, 0.02, 0.12, 0.06, 0.38, 0.21, 0.1, 0, 0.13,
0.17, 0, 0.1, 0.12, 0.17, 0, 0.42, 0.15, 0.15, 0.42, 0.04,
0.04, 0.69, 0.15, 0, 0, 0.17, 0.4, 0.23, 0.27, 0.04, 0.17,
0.06, 0, 0, 0.06, 0.21, 0.04, 0.29, 0.04, 0.19, 0, 0.19,
0.02, 0.02, 0.29, 0.35, 0.19, 0.23, 0.42, 0.02, 0.35, 0.29,
0.02, 0.17, 0.1, 0.06, 0.17, 0.1, 0.38, 0.02, 0.15, 0.17,
0.29, 0.04, 0.02, 0.38, 0.12, 0.17, 0.02, 0, 0.06, 0.12,
0.08, 0.13, 0.12, 0.1, 0.33, 0.23, 0.29, 0.31, 0.19, 0.17,
0, 0.33, 0.17, 0.38, 0.02, 0.21, 0.17, 0.19, 0.06, 0.29,
0.12, 0.02, 0.15, 0.13, 0.17, 0.25, 0.02, 0.15, 0.65, 0.48,
0.29, 0.02, 0.19, 0.29, 0.27, 0.06, 0.02, 0.29, 0.21, 0.15,
0.12, 0.19, 0.44, 0.1, 0.04, 0.12, 0.15, 0.27, 0.1, 0.15,
0.1, 0.06, 0.15, 0.06, 0.15, 0.13, 0.54, 0.19, 0.04, 0.33,
0.06, 0.25, 0.17, 0.29, 0.12, 0.25, 0.1, 0.31, 0.13, 0.1,
0.1, 0.02, 0.25, 0.02, 0.15, 0.13, 0.29, 0.15, 0.77, 0.1,
0.08, 0.38, 0.4, 0.02, 0.37, 0, 0.12, 0.27, 0.25, 0.46, 0,
0.02, 0.12, 0, 0.27, 0.02, 0, 0.13, 0.04, 0.08, 0.13, 0.25,
0.08, 0.06, 0, 0.06, 0.12, 0.33, 0.15, 0.67, 0.04, 0.31,
0.21, 0.19, 0.25, 0.27, 0.02, 0.1, 0.1, 0.06, 0.44, 0.35,
0.23, 0.1, 0.15, 0.21, 0.08, 0.02, 0.37, 0.27, 0.17, 0.1,
0.04, 0.19, 0.42, 0.27, 0.29, 0.63, 0.54, 0.29, 0.02, 0.44,
0.35, 1.35, 0, 0.4, 0.25, 0.04, 0.02, 0.02, 0.17, 0.19, 0.17,
0.1, 0.42, 0.13, 0.13, 0.1, 0.1, 0.06, 0.04, 0.04, 0.44,
0.06, 0.04, 0.1, 0.21, 0.06, 0.02, 0.19, 0.27, 0.44, 0.02,
0.17, 0.06, 0.02, 0.17, 0.15, 0.15, 0.15, 0.12, 0.02, 0,
0, 0.21, 0.02), Online = c(1.63, 2.6, 0.48, 1.9, 5.27, 1.23,
1.87, 4.56, 3.71, 2.4, 9.62, 1.15, 1.5, 1.96, 2.5, 10.37,
2.62, 7.44, 2.71, 1.48, 16.94, 3.92, 2.9, 4.44, 2.69, 6.04,
2.69, 1.44, 0.52, 0.48, 1.44, 0.85, 4.56, 1.81, 9.25, 3.12,
5.56, 2.33, 4.67, 2.54, 3.73, 1.63, 3.4, 1.9, 1.15, 1.08,
6.27, 2.23, 3.13, 2.02, 0.63, 3.31, 2.96, 4.56, 3.19, 2.62,
6.21, 8.6, 2.23, 2.33, 0.9, 2.6, 0.94, 1.58, 0.85, 3.38,
4.04, 6.46, 3.17, 4.79, 7.92, 6.58, 1.63, 5.88, 5.06, 6.42,
2.69, 4.4, 2.08, 2.81, 3.23, 1.6, 3.08, 5.77, 1.65, 2.56,
3.81, 4.08, 3.65, 5.06, 1.15, 1.15, 1.08, 3.77, 2.75, 2.6,
2.56, 4.37, 4.92, 2.12, 1.58, 0.1, 1.87, 1.44, 4.02, 2.5,
1.29, 2.33, 6.12, 4.62, 1.98, 5.77, 3.19, 0.9, 1.5, 9.77,
7.63, 5.37, 0.79, 1.17, 4.23, 2.81, 4.31, 2.71, 3.4, 6.38,
2.75, 1.23, 4.77, 2.4, 6.04, 0.58, 0.79, 8.08, 2.13, 1.75,
0.87, 2.19, 1.38, 2.54, 2.71, 1.65, 3.5, 1.85, 18.52, 2.08,
0.33, 3.19, 6.69, 1.06, 3.08, 1.81, 1.06, 0.48, 0.85, 3.65,
1.44, 1.63, 1.71, 3.5, 2.12, 9.62, 1.96, 7.48, 1.65, 3.19,
11.04, 1.81, 3.4, 3.73, 6.1, 0.9, 10.31, 4.46, 2.27, 1.17,
0.94, 2.02, 2.75, 6.38, 3.83, 4.98, 3.77, 2.71, 5.63, 1.21,
3.31, 0, 9.35, 5.56, 1.79, 6.15, 1.9, 3.4, 6.52, 0.63, 1.37,
4.25, 1.71, 0.69, 0.75, 1.23, 2.69, 2.02, 1.79, 3.56, 0.75,
0.75, 0.52, 1.21, 1.12, 0.69, 1.79, 4.56, 1.23, 4.83, 5.04,
2.38, 1.23, 5.4, 3.13, 2.62, 1.08, 13.38, 3.52, 5.19, 3.62,
1.08, 4.5, 10.19, 2.33, 4.73, 1.87, 9.4, 11.21, 1.65, 2.29,
2.9, 35.94, 3.19, 2.4, 1.79, 7.58, 5.4, 4.73, 1.21, 1.54,
1.75, 2.98, 2.27, 2.08, 2.08, 4.35, 5.85, 3.12, 1.63, 5.06,
1.65, 4.92, 4.77, 5.06, 5, 5.27, 8.75, 3.56, 5.77, 6.21,
10.13, 6, 7.69, 1.92, 3.81, 7.92, 1.63, 4.29, 3.46, 7.65,
8.35, 1, 6.27, 6.96, 2.17, 14.81, 10.65, 0.04, 2.54, 1.38,
0.85, 5.79, 3.5, 6.6, 6.04, 2.13, 4.04, 5.63, 4.94, 1.27,
2.5, 6.42, 4.83, 4.35, 3.19, 4.1, 1.38, 1.63, 2.4, 6.96,
0.63, 2.12, 8.65, 3.67, 1.9, 2.08, 5.46, 3.71, 1.69, 2.81,
0.6, 2.06, 5.1, 2.87, 5.27, 6.54, 2.56, 0.42, 0.33, 1.12,
1.06, 1.6, 1.37, 2.23, 1.08, 1.75, 0.6, 0.9, 5.1, 2.27, 0.73,
1.33, 1.06, 1.96, 1.98, 3.98, 1.75, 1.87, 9.73, 12, 1.15,
1.23, 3.29, 1.92, 6.06, 4.44, 2.48, 1.37, 5.58, 2.12, 1.81,
1.17, 0.27, 1.6, 4.85, 1.17, 2.48, 1.63, 2.17, 1.71, 4.15,
0.48, 1.44, 1.08, 4.67, 4.56, 0.52, 6.06, 1.63, 2.35, 1.23,
1.96, 14.35, 0.58, 1.54, 1.5, 1.9, 2.54, 2.48, 2.77, 19.6,
3.35, 0.73, 1.69, 1.17, 0.85, 3.23, 0.17, 2.27, 3.71, 2.27,
2.4, 1.37, 1.5, 2.02, 0.12, 0.25, 0.38, 17.13, 2.65, 0.31,
1.85, 3.13, 1.54, 3.38, 2.98, 3.71, 2.23, 4.58, 3.29, 1.02,
7.12, 1.96, 1.85, 0.85, 2.69, 1.81, 1.21, 1.06, 3.13, 1.44,
2.71, 3.4, 3.98, 3.08, 0.9, 5, 0, 0, 0, 0, 0, 2.06, 0.75,
5.25, 2.06, 3.38, 3.04, 7.9, 4.73, 1.44, 10.67, 0.06, 7.42,
2.19, 4.5, 2.44, 3.13, 3.52, 2.75, 0.27, 7.1, 5.63, 0.52,
1.15, 2.48, 2.48, 3.71, 1.6, 1.98, 2.06, 1.5, 4.56, 1.08,
0.25, 1.15, 4.79, 2.6, 4.73, 2.6, 0.15, 0.15, 5.27, 1.21,
5, 1.29, 3.38, 0.85, 2.27, 0, 0.73, 0.38, 0.38, 0.94, 0.38,
2.08, 1.71, 4.29, 0.94, 5.62, 2.23, 0.38, 1.23, 2.06, 0.65,
4.71, 2.19, 3.08, 1.21, 1.38, 2.06, 0.54, 0.81, 1.08, 4.35,
12.6, 8.98, 1.87, 1.58, 0.27, 0.46, 19.65, 0.38, 1.37, 2.06,
1.98, 0.31, 0.46, 0.6, 0.38, 0.31, 3.77, 2.5, 15.56, 5.27,
12.58, 7.33, 11.06, 9.33, 12.79, 15.29, 7.12, 7.23, 14.17,
12.06, 12, 6.54, 6, 15.35, 10.71, 14.69, 6.94, 6.12, 5.73,
7.17, 4.15, 15.77, 7.02, 12.75, 11.56, 8.12, 6.46, 7.12,
9.02, 11.04, 10.79, 10.08, 8.08, 8.21, 9.81, 8.92, 10.73,
10.15, 9.35, 8.62, 6.27, 13.23, 14.02, 14.13, 6.25, 7.37,
6.06, 21.4, 6.63, 7.1, 8.62, 17.29, 8.4, 7.44, 5.77, 10.77,
56.38, 9.77, 11.98, 8.9, 6.06, 5.77, 13.48, 14.23, 8.17,
9.62, 11.62, 6, 12.38, 7.42, 7.23, 5.79, 8.08, 8.35, 4.73,
7.58, 6.15, 6.88, 15.65, 13.02, 7.71, 18.33, 5.69, 4.5, 7.96,
5.35, 21.17, 4.29, 9.17, 13.96, 8.69, 8.5, 12.94, 7.1, 6.15,
19.94, 7.54, 13.9, 11.56, 11.4, 11.31, 19.6, 8.83, 11.19,
9.94, 7.5, 8, 6, 4.85, 6.15, 9.94, 8.02, 11.15, 15.13, 7.06,
10.37, 10.04, 27.02, 8.17, 13.6, 11.04, 11.15, 6.1, 4.37,
7.02, 15.5, 13.15, 7.75, 9.19, 11.48, 8.81, 10.23, 12.1,
5.96, 8.13, 12.48, 8.21, 9.44, 13.15, 9.54, 19.9, 4.71, 4.63,
23.63, 24.31, 10.79, 15.35, 12.79, 10.31, 20.85, 9.02, 15.04,
9.4, 4.63, 11.27, 5.96, 40.12, 8.77, 7.79, 8.27, 7.1, 11.62,
3.81, 5.67, 5.35, 8.6, 7.33, 7.6, 8.87, 17.77, 7.92, 5.9,
6.85, 12.54, 21.08, 15.08, 9.02, 3.98, 11.67, 32.79, 5.21,
5, 6.38, 10.31, 21.35, 18.06, 13.17, 16.52, 17.04, 10.4,
4.29, 21.19, 8.71, 8.75, 14.5, 5, 8.29, 9.19, 19.87, 4.5,
3.87, 6.73, 6.75, 22.87, 8.4, 13.38, 16.79, 3.31, 8.5, 12.48,
6.33, 10.25, 9.87, 6.04, 14.33, 6.04, 5.79, 5.63, 10.73,
13.58, 8.87, 11.88, 9.12, 12.21, 10.08, 7.5, 13.9, 10.92,
8.4, 9.65, 9.25, 13.75, 9.46, 12.33, 10.02, 98.77, 11.21,
5.77, 5.19, 12.9, 10.1, 10.56, 6.12, 6.17, 7.44, 2.08, 0.65,
2.92, 0.42, 4.1, 8.62, 1.37, 2.35, 2.56, 1.15, 2.17, 0.69,
4.02, 1.81, 1.37, 2.87, 3.29, 2.96, 1.42, 2.62, 0.48, 2.35,
5.27, 2.23, 1.38, 3.31, 8.87, 3.25, 2.98, 3.94, 2.13, 1.85,
5.19, 2.9, 2.23, 2.38, 0.9, 2.92, 0.96, 0.75, 2.33, 4.88,
4.08, 3.65, 7.87, 11.35, 2.83, 3.62, 3.12, 4.79, 4.62, 5.27,
5.25, 6, 2.29, 1.44, 1.06, 2.44, 1.42, 2.6, 4.67, 4.1, 1.06,
2.83, 2.87, 1.5, 1.5, 0.87, 0.73, 3.83, 2.71, 0.65, 2.35,
1.37, 4.23, 2.17, 1.81, 2.77, 1.23, 1.96, 1.37, 4.44, 3.35,
1.96, 2.33, 1.33, 1.38, 6.67, 2.75, 1.48, 2.62, 1.65, 2.29,
5, 1.81, 2.08, 1.27, 3.4, 1.42, 2.23, 0.37, 1.69, 2.23, 2.83,
0.69, 4.71, 1.85, 1.23, 2.71, 8.12, 1.87, 2.62, 0.85, 3.12,
4.88, 1.23, 2.13, 0.52, 4.73, 4.31, 1.23, 0.38, 0.48, 0.58,
1.27, 3.31, 12.46, 2.4, 5.13, 2.81, 2.87, 2.44, 6.69, 1.85,
5.1, 2.29, 4.35, 1.6, 3.25, 3.13, 1.98, 1.79, 2.87, 2.33,
4.31, 0.73, 0.46, 2.83, 1.06, 0.73, 3.94, 0.42, 6.48, 2.4,
5.37, 2.71, 3.38, 1.81, 1.87, 5.13, 0.87, 0.9, 3.38, 0.81,
1.06, 0.96, 0.63, 2.87, 1.5, 1.29, 4.1, 1.54, 2.13, 6.42,
3.17, 3.25, 2.44, 3.19, 1.81, 2.4, 3.83, 3.71, 2.71, 3.04,
15.13, 4.73, 3.17, 2.62, 8.69, 7.1, 2.13, 2.02, 1.42, 2.19,
3.44, 3.56, 3.67, 8.17, 0.63, 3.35, 1.9, 0.87, 1.75, 4.4,
7.12, 3.46, 4.56, 2.81, 1.08, 0.81, 2.27, 2.23, 0.94, 4.92,
3.44, 2.87, 2.65, 6.31, 2.5, 1.85, 1.44, 1.71, 1.15, 1.37,
0.31, 2.9, 3.5, 3.17, 0.48, 0.85, 1.65, 3.56, 6.81, 1.17,
0, 4.02, 2.71, 1.96, 3.44, 10.23, 2.98, 2.54, 4.1, 1.65,
2.4, 4.88, 2.75, 1.9, 2.75, 1.69, 5.37, 7.33, 6.06, 4.19,
1.6, 0.75, 6.63, 2.87, 3.77, 1.85, 1.69, 1.6, 4.85, 5.35,
2.65, 2.75, 2.83, 0.42, 4.88, 3.04, 9.44, 11.79, 4.79, 1.5,
3.52, 0.87, 1.71, 1.15, 1.02, 0.87, 3.35, 7.06, 4.19, 0.94,
0.63, 2.06, 4.62, 2.6, 1.29, 3.73, 4.25, 3.87, 4.23, 1.92,
6.15, 2.12, 4.83, 2.35, 2.29, 6.67, 1.38, 1.15, 1.54, 1.92,
1.75, 1.15, 0, 0, 2.96, 1.08, 0.17, 4.98, 3.5, 4.62, 1.65,
0.1, 2.92, 3.77, 1.65, 0, 1.69, 6.04, 3.88, 3.25, 2.44, 2.75,
1.63, 2.6, 3.04, 0.63, 2.06, 0.15, 0.63, 3.35, 1.15, 0.69,
2.5, 2.6, 0.96, 1.27, 3.6, 2.5, 3.77, 0.81, 0.96, 5.96, 1.12,
0.81, 0.85, 1.38, 4.1, 1.63, 1.69, 0.12, 5.62, 2.98, 3.44,
0.87, 3.17, 1.98, 2.92, 9.54, 0.06, 3.88, 0.81, 1.27, 0.46,
1.12, 2.13, 3.83, 8.83, 1.48, 7.23, 0.48, 1.58, 0.54, 3.12,
3.44, 0.54, 0.17, 3.6, 0.33, 0.81, 0.6, 0.37, 1.17, 2.6,
2.92, 1.81, 3.62, 2.98, 2.06, 4.35, 1.69, 0.37, 1.06, 2.23,
1.42, 0.73, 2.06, 1.38, 1.12, 2.19, 1.15, 0.6, 0.31, 3.83,
1.6, 3.98, 2.35, 13.9, 0.37, 1.85, 3.6, 2.19, 4.5, 0.42,
0.27, 4.23, 5.21, 4.04, 1.33, 5.06, 0, 10.35, 3.19, 2.33,
7.17, 0.52, 0.69, 4.04, 8.21, 7.44, 5.69, 3.5, 2.62, 7.42,
1.85, 4.02, 2.27, 16.15, 7.33, 1.42, 12.31, 3.04, 1.17, 3.17,
9.33, 4.71, 4.67, 4.46, 3.87, 0.21, 2.17, 6.73, 11.88, 2.98,
1.29, 15.87, 0.42, 1.6, 2.23, 1.21, 1.33, 2.81, 3.67, 3.13,
4.71, 6.21, 7.15, 1.44, 3.46, 3.04, 1.85, 1.37, 2.69, 3.71,
5.85, 1.12, 16.58, 2.9, 9.46, 4.58, 2.27, 5.15, 3.94, 2.38,
1, 4.52, 0.65, 1.87, 2.02, 0.15, 1.9, 16.31, 2.5, 4.08, 4.08,
5.21, 5.62, 3.62, 2.56, 1.63, 9.87, 0.63, 1.85, 3.19, 9.62,
3.71, 2.06, 4.79, 9.25, 5.96, 1.63, 2.27, 0.37, 2.9, 3.88,
4.08, 5.63, 5.94, 2.27, 3.38, 4.85, 2.4, 2.35, 0.52, 1.29,
3.52, 1.6, 4.77, 22.02, 3.94, 1.33, 1.33, 1.33, 14.63, 1.98,
6.12, 7.9, 1.5, 1.15, 5.85, 0.9, 2.17, 0.81, 2.17, 4.56,
2.23, 6.27, 10.58, 4.5, 7.96, 2.33, 6.25, 2.44, 3.02, 4.31,
6.58, 2.06, 3.5, 5.4, 0.69, 8, 1.71, 1.44, 0.85, 1.69, 7.54,
2.33, 1.37, 2.17, 2.92, 1.65, 1.69, 3.83, 3.35, 0.79, 3.4,
1.81, 0.81, 2.77, 3.12, 6.75, 1.6, 1.69, 2.54, 3.65, 3.65,
12.6, 3.29, 1.44, 1.65, 5.94, 6, 6.38, 1.48, 9.25, 1.21,
8.98, 2.35, 2.19, 2.71, 14.23, 1.69, 8.12, 23.46, 2.77, 1,
2.44, 1.27, 1.9, 6.63, 0.96, 0.87, 6.33, 1.21, 0.73, 5.9,
0.69, 1.81, 3.65, 4.46, 12, 6.21, 3.35, 1.02, 0.46, 0.21,
0.04, 6.04, 2.23, 1.42, 1.63, 1.58, 6.94, 5.35, 2.33, 1.92,
1.12, 8.98, 2.56, 0.87, 2.27, 1.08, 2.19, 10.67, 6.21, 0.38,
1.44, 0.04, 1, 1.21, 7.33, 0), row.names = c(NA,
-1432L), class = "data.frame")
Dput(Hours)
Days = c(8.5, 8.5, 8.5, 8.5, 8.5, 8, 8.5,
8.5, 8.5, 8.5, 8.5, 8, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 8,
9, 9, 9, 9, 9, 4, 9.5, 9.5, 9.5, 9.5, 9.5, 4, 9, 9, 9, 9,
9, 8.5, 10, 13, 13, 13, 13, 13, 10, 9, 9, 9, 9, 9, 4, 9.25,
9.25, 9.25, 9.25, 9.25, 3, 8.75, 8.75, 8.75, 8.75, 8.75,
8.25, 8.5, 8.5, 8.5, 8.5, 9, 4, 4, 9, 9, 9, 9, 9, 8, 8.75,
8.75, 8.75, 8.75, 8.75, 4.25, 9, 9, 9, 9, 9, 8.5, 9, 9, 9,
13, 9.5, 9.5, 9.5, 9.5, 9.5, 4, 9, 9, 9, 9, 9, 9.5, 9.5,
9.5, 9.5, 9.5, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 4, 9, 9, 9,
9, 9, 9, 9, 8.5, 8.5, 9, 3, 9, 9, 9, 9, 9, 10, 15, 15, 15,
15, 15, 15, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5,
8.5, 7, 10, 15, 15, 15, 15, 15, 15, 11, 11, 11, 11, 11, 9.5,
9.5, 9.5, 9.5, 9.5, 4, 9, 9, 9, 9, 9, 8.5, 9, 9, 9, 9, 9,
9, 9.5, 9.5, 9.5, 9.5, 9.5, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5,
8, 9, 9, 9, 9, 9, 6, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5,
6, 12, 12, 12, 12, 12, 12, 6, 12, 12, 12, 12, 12, 12, 6,
12.5, 12.5, 12.5, 12.5, 12.5, 12.5, 9, 9, 9, 9, 9, 10.5,
10.5, 10.5, 10.5, 10.5, 7.5, 6, 11.5, 11.5, 11.5, 11.5, 11.5,
11.5, 12, 12, 12, 12, 12, 5, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 3, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 5,
10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 8, 8.5, 8.5, 8.5, 8.5,
8.5, 8, 9.5, 9.5, 9.5, 9.5, 9.5, 3.5, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 3.5, 9.5, 9.5, 9.5, 9, 9.5, 8, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 8.5, 8.5, 8.5, 8.5, 8.5, 9, 9,
9, 9, 9, 10, 15, 15, 15, 15, 15, 15, 10, 10, 10, 10, 10,
10, 9, 9, 9, 9, 9, 9.5, 9.5, 9.5, 9.5, 9.5, 6, 14, 14, 14,
14, 14, 14, 6, 12, 12, 12, 12, 12, 12, 6, 12, 12, 12, 12,
12, 12, 6, 12, 12, 12, 12, 12, 12, 9, 9, 9, 9, 9, 4, 9, 9,
9, 9, 9, 8, 9.5, 9, 9, 9, 9, 3, 9.5, 9.5, 9.5, 9.5, 9.5,
3.5, 10, 10, 10, 10.5, 10, 4, 11, 11, 12, 11, 12, 10, 10,
10, 10, 10, 6, 10.5, 10.5, 10.5, 10.5, 10.5, 9, 9, 9, 9,
9, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 4, 9.5, 9.5,
9.5, 9.5, 9.5, 9.75, 9.75, 9.75, 9.75, 9.75, 9, 9, 9, 9,
9, 9.25, 9.25, 9.25, 9.25, 9.25, 4, 10.25, 10.25, 10.25,
10.25, 10.25, 6, 9.5, 9.5, 9.5, 9.5, 9.5, 8.5, 8.5, 8.5,
8.5, 8.5, 8.5, 9, 9, 9, 9, 9, 4, 8.5, 8.5, 8.5, 8.5, 8.5,
8.5, 8, 16, 16, 16, 16, 16, 12, 9, 9, 9, 9, 9, 9.5, 9.5,
9.5, 9.5, 9.5, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 8, 10.5,
10.5, 10.5, 10.5, 10.5, 10, 11.5, 11.5, 11.5, 10.5, 10.5,
4, 9, 9, 9, 9, 9, 9, 9.5, 9.5, 9.5, 9.5, 9.5, 3, 9.5, 9.5,
9.5, 9.5, 9.5, 3, 9.5, 9.5, 9.5, 9.5, 9.5, 9, 9, 9, 9, 9,
4, 10, 10, 10, 7.5, 10, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5,
9.5, 7.5, 9.5, 2.5, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 9.5,
9.5, 9.5, 9.5, 9.5, 3, 10.5, 10.5, 10.5, 10.5, 10.5, 9, 9,
9, 9, 9, 6, 13.5, 13.5, 13.5, 13.5, 13.5, 13.5, 9.5, 9.5,
9.5, 4.5, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5, 4, 9.5, 9.5, 9.5,
9.5, 9.5, 3, 9, 9, 9, 9, 9, 4, 10, 10, 10, 10, 10, 4, 9.75,
9.75, 9.75, 9.75, 9.75, 4, 9.75, 9.75, 9.75, 9.75, 9.75,
9.25, 9.25, 9.25, 4, 9.25, 9.5, 9.5, 9.5, 3.5, 9.5, 9.5,
9.5, 9.5, 9.5, 9.5, 9.75, 9.75, 9.75, 4.5, 9.75, 9, 9, 9,
9, 9, 4, 9.25, 9.25, 9.25, 9.25, 9.25, 2.5, 12, 10.5, 10.5,
10.5, 10.5, 9.75, 9.75, 9.75, 9.75, 9.75, 10, 10, 10, 10,
10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 6,
14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 6, 12, 12, 12, 12, 12,
12, 6, 12, 12, 12, 12, 12, 12, 6, 14.5, 14.5, 14.5, 14.5,
14.5, 14.5, 6, 12, 12, 12, 12, 12, 12, 9.25, 9.25, 9.25,
9.25, 9.25, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 6, 9, 9, 9, 9,
9, 9.5, 9.5, 9.5, 9.5, 9.5, 10, 10, 10, 10, 10, 6, 10.75,
10.75, 10.75, 10.75, 10.75, 10, 10.75, 10.75, 10.75, 10.75,
10.75, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 4, 10, 10, 10, 10, 10,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 4, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 5,
9, 9, 9, 9, 9, 5, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9.5, 9.5, 9.5, 9.5, 9.5, 9, 9, 4, 9, 9, 9, 9, 9,
9, 9, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 4, 9, 9, 9, 9, 9, 6, 14.5, 14.5, 14.5, 14.5,
14.5, 14.5, 6, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 6, 14.5,
14.5, 14.5, 14.5, 14.5, 14.5, 6, 12, 12, 12, 12, 12, 12,
6, 12.5, 12.5, 12.5, 12.5, 12.5, 12, 6, 14, 14, 14, 14, 14,
14, 6, 12, 12, 12, 12, 12, 12, 6, 14.5, 14.5, 14.5, 14.5,
14.5, 14.5, 6, 4, 4, 4, 4, 4, 3, 9.75, 9.75, 9.75, 9.75,
9.75, 3.5, 9, 9, 9, 9, 9, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5,
9.5, 9.5, 9.5, 9.75, 9.75, 9.75, 9.75, 9.75, 9, 9, 9, 9,
9, 9.5, 9.5, 9.5, 9.5, 9.5, 10, 10, 10, 10, 10, 4, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9.5, 9.5, 9.5, 9.5, 9.5, 11, 11,
11, 11, 11, 9.75, 9.75, 9.75, 9.75, 9.75, 10, 10, 10, 10,
10, 4, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10,
10, 8, 9, 9, 9, 9, 9, 4, 9, 9, 9, 9, 9, 13.75, 14.5, 14.5,
14.5, 14.5, 14.5, 13.75, 4, 9.5, 9.5, 9.5, 9.5, 9.5, 8.5,
9.5, 9.5, 9.5, 9.5, 9.5, 8, 9.5, 9.5, 9.5, 9.5, 9.5, 8, 9.5,
9.5, 9.5, 9.5, 9.5, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 9,
9, 9, 9, 9, 8.5, 5, 14, 14, 14, 14, 14, 12, 10.5, 10.5, 10.5,
10.5, 10.5, 4, 10.5, 10.5, 10.5, 10.5, 10.5, 9, 9, 9, 9,
9, 8.5, 9, 9, 9, 9, 9, 8.5, 10, 10, 10, 10, 10, 3, 9, 9,
9, 9, 9, 8, 9, 9, 11, 11, 11, 8, 9, 9, 9, 9, 9, 8.5, 9, 9,
9, 9, 9, 4, 9, 9, 9, 9, 9, 8.5, 9, 9, 9, 9, 9, 4, 9, 9, 9,
9, 9, 9, 5, 9, 9, 12, 12, 12, 8.5, 9, 9, 9, 9, 9, 4, 8.5,
8.5, 8.5, 8.5, 8.5, 4, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5,
8.5, 8.5, 8.5, 8.5, 4, 9.5, 9.5, 9.5, 9.5, 9.5, 4, 3, 11,
11, 11, 11, 11, 9, 9.5, 9.5, 9.5, 9.5, 9.5, 5, 9, 9, 9, 9,
9, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 4, 8.5, 8.5, 8.5, 8.5, 8.5,
8, 8.5, 8.5, 8.5, 8.5, 8.5, 7.5, 9.5, 9.5, 9.5, 9.5, 9.5,
4, 9.5, 9.5, 9.5, 9.5, 9.5, 8, 8.5, 8.5, 8.5, 8.5, 8.5, 8.5,
4, 9.5, 9.5, 9.5, 9.5, 9.5, 8.5, 9, 9, 9, 9, 9, 8.5, 6, 12.5,
12.5, 12.5, 12.5, 12.5, 11.5, 6, 11.5, 11.5, 11.5, 11.5,
11.5, 12, 6, 12, 12, 12, 12, 12, 12, 6, 12, 12, 12, 13, 13,
12, 6, 12, 12, 12, 12, 12, 12, 6, 15.5, 15.5, 15.5, 15.5,
15.5, 15.5, 9.5, 9.5, 9.5, 9.5, 9.5, 4, 10, 10, 10, 10, 10,
4, 10, 10, 10, 10, 10, 8, 9.5, 9.5, 9.5, 9.5, 9.5, 4, 9,
9, 9, 9, 9, 8, 9.5, 9.5, 9.5, 9.5, 9.5, 8, 9.5, 9.5, 9.5,
9.5, 9.5, 3, 9, 9, 9, 9, 9, 7, 4, 9.5, 9.5, 9.5, 9.5, 9.5,
8.5, 13, 12.5, 12.5, 12.5, 12.5, 12.5, 13, 9.5, 9.5, 9.5,
9.5, 9.5, 8, 9, 9, 9, 9, 9, 8.5, 10.5, 10.5, 10.5, 10.5,
10.5, 9.5, 9.5, 9.5, 9.5, 9.5, 8, 10.5, 10.5, 10.5, 10.5,
10.5, 8, 9, 9, 9, 9, 9, 4, 10, 10, 10, 10, 10, 8, 10, 10,
10, 10, 10, 8, 9.5, 9.5, 9.5, 9.5, 9.5, 4, 9.5, 9.5, 9.5,
9, 9.5, 4, 10, 10, 10, 10, 10, 8, 10, 11, 10, 10, 10, 10,
10, 10, 10, 10, 9.5, 9.5, 9.5, 9.5, 9.5, 4, 10.5, 10.5, 10.5,
10.5, 10.5, 8, 10.25, 10.25, 10.25, 10.25, 10.25, 9.5, 9.5,
9.5, 9.5, 9.5, 10, 10, 10, 10, 10, 4, 9.5, 9.5, 9.5, 9, 9.5,
4, 10, 10, 10, 10, 10, 4, 10, 10, 10, 10, 10, 8.5, 9, 9,
9, 9, 9, 4, 6, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 6, 16,
16, 16, 16, 16, 15, 6, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5,
6, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 6, 14.5, 14.5, 14.5,
14.5, 14.5, 14.5, 6, 13.5, 13.5, 13.5, 13.5, 13.5, 13.5,
6, 4, 4, 4, 4, 4, 3, 9.5, 9.5, 9.5, 9.5, 9.5, 8, 9, 9, 9,
9, 9, 8.5, 9.5, 9.5, 9.5, 9.5, 9.5, 4, 9, 9, 9, 9, 9, 4,
9.5, 9.5, 9.5, 9.5, 9.5, 4, 9, 9, 9, 9, 9, 4, 10.5, 10.5,
10.5, 10.5, 10.5, 8.5, 9.75, 9.75, 9.75, 9.75, 9.75, 4, 10,
10, 10, 10, 10, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9, 10, 10,
10, 10, 10, 8.5, 9.5, 9.5, 9.5, 9.5, 9.5, 9.25, 9.25, 9.25,
9.25, 9.25, 4, 9, 9, 9, 9, 9, 9.5, 9.5, 9.5, 9.5, 9.5, 13,
14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 10, 10, 10, 10, 10, 13,
14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 10, 10, 10, 10, 10, 9,
10, 10, 10, 10, 10, 4, 9.5, 9.5, 9.5, 9.5, 9.5, 8.5, 9.5,
9.5, 9.5, 9.5, 9.5, 3, 9.5, 9.5, 9.5, 9.5, 9.5, 8.25, 10,
10, 10, 10, 10, 4, 9.5, 9.5, 9.5, 9.5, 9.5, 8.5, 9.5, 9.5,
9.5, 9.5, 9.5, 8.5, 9.75, 9.75, 9.75, 9.75, 9.75, 4, 9, 9,
9, 9, 9, 4, 9.5, 9.5, 9.5, 9.5, 9.5, 4, 6, 14.5, 14.5, 14.5,
14.5, 14.5, 14.5, 6, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5,
6, 12, 12, 12, 12, 12, 12, 6, 14.5, 14.5, 14.5, 14.5, 14.5,
14.5, 6, 14, 14, 14, 14, 14, 14, 6, 14.5, 14.5, 14.5, 14.5,
14.5, 14.5, 6, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 9, 9,
9, 9, 9, 7, 6, 9.5, 9.5, 9.5, 10.5, 10.5, 8, 8.5, 8.5, 8.5,
8.5, 8.5, 8.5, 10, 10, 10, 10, 10, 9.5, 9.5, 9.5, 9.5, 9.5,
3, 9.5, 9.5, 9.5, 9.5, 9.5, 4, 9, 9, 9, 9, 9, 8, 9.5, 9.25,
9.25, 9.25, 9.5, 8.5, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9,
4, 10, 10, 10, 10, 10, 8.5, 8.5, 8.5, 8.5, 8.5, 10, 10, 10,
10, 10, 9.5, 9.5, 9.5, 9.5, 9.5, 9, 9, 9, 9, 9, 8.5, 10,
10, 10, 10, 10, 8.5, 10.25, 10.25, 10.25, 10.25, 10.25, 4,
9, 9, 9, 9, 9, 5, 9.75, 9.75, 9.75, 9.75, 9.75, 4, 9, 9,
9, 9, 9, 8.5, 9, 9, 9, 9, 9, 8, 10, 10, 10, 10, 10, 9.5,
9.5, 9.5, 9.5, 9.5, 8.5, 9.75, 9.75, 9.75, 9.75, 9.75, 4,
8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 10, 10, 10, 10, 10, 9.5, 9.5,
9.5, 9.5, 9.5, 4, 10, 10, 10, 10, 10, 4, 9.5, 9.5, 9.5, 9.5,
9.5, 8, 10, 10, 10, 10, 10, 6, 12, 12, 12, 12, 12, 12, 6,
14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 6, 12, 12, 12, 12, 12,
11, 6, 16, 16, 16, 16, 16, 15, 6, 12, 12, 12, 12, 12, 12,
6, 12, 12, 12, 12, 12, 11, 6, 16, 16, 16, 16, 16, 15, 10.25,
10.25, 10.25, 10.25, 10.25, 4, 10.5, 10.5, 9.5, 9.5, 9.5,
4, 10, 10, 10, 10, 10, 4, 9, 9, 9, 9, 9, 8, 9, 9, 9, 9, 9,
4, 8, 15.5, 15.5, 15.5, 15.5, 15.5, 14.5, 9.5, 9.5, 9.5,
9.5, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5, 10, 10, 10, 10, 10, 9,
9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 8.5,
9.5, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5, 4.5, 10,
10, 10, 10, 10, 8.5, 9, 9, 9, 9, 9, 4, 10.5, 10.5, 10.5,
10.5, 10.5, 8.5, 8.5, 8.5, 8.5, 8.5, 8, 9, 9, 9, 9, 9, 8,
10.5, 10.5, 10.5, 12, 10.5, 10, 10.5, 10, 10.5, 10, 10, 10,
10, 10.5, 10, 9.5, 9.5, 9.5, 9.5, 9.5, 8, 10, 10, 10, 10,
10, 10.5, 10.5, 10.5, 10.5, 10.5, 8, 9, 9, 9, 9, 9, 8, 10,
10, 10, 10, 10, 3.5, 10, 10, 10, 10, 10, 8, 10, 10, 10, 10,
10, 4, 10, 10, 10, 10, 10, 5, 9, 9, 9, 9, 9, 8.5, 9.5, 9.5,
9.5, 9.5, 9.5, 8, 10, 10, 10, 10, 10, 10.75, 10.75, 10.75,
11.75, 10.75, 9.5, 9.5, 9.5, 9.5, 9.5, 4, 6, 14.5, 14.5,
14.5, 14.5, 14.5, 14.5, 6, 14.5, 14.5, 14.5, 14.5, 14.5,
14.5, 6, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 6, 12, 12, 12,
13, 13, 12, 6, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 10.5,
10.5, 10.5, 10.5, 10.5, 8.5, 10, 10, 10, 10, 10, 4, 10.75,
9.75, 10, 9.75, 9.75, 9.5, 9.5, 9.5, 9.5, 9.5, 8, 9.5, 9.5,
9.5, 9.5, 9.5, 8.5, 10.5, 10.5, 8.5, 10.5, 10.5, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 8.5, 10, 10, 10, 10, 10,
8.5, 11.5, 11.5, 11.5, 11.5, 11.5, 10, 10, 10, 10, 10, 8.5,
10, 10, 10, 10, 10, 4, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9,
8.5, 8.5, 8.5, 8.5, 8.5, 8.5, 10, 10, 10, 10, 10, 9, 9, 9,
8, 9, 9.5, 9.5, 9.5, 9.5, 9.5, 12, 13, 13, 13, 13, 13, 13,
10.5, 10.5, 10, 10.5, 10.5, 9, 9, 9, 9, 9, 4, 10, 10, 10,
10, 10, 8.5, 10, 10, 10, 10, 10, 8.5, 10, 10, 10, 10, 10,
3, 10, 10, 10, 10, 10, 4, 10.5, 10.5, 10.5, 11.5, 10.5, 10,
10, 10, 10, 10, 10, 10, 10.5, 10.5, 10, 8.5, 10.5, 10.5,
10.5, 10.5, 10.5, 4, 6, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5,
6, 12, 12, 12, 12, 12, 12, 6, 14.5, 14.5, 14.5, 14.5, 14.5,
14.5, 6, 13, 13, 13, 13, 13, 13, 6, 14.5, 14.5, 14.5, 14.5,
14.5, 14.5, 9.75, 9.5, 9.75, 9.5, 9.75, 4, 11.25, 9.75, 9.75,
9.75, 9.75, 11.5, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15,
15, 10, 10, 10, 10, 10, 9.5, 9.5, 9.5, 9.5, 9.5, 4, 10.5,
10.5, 10.5, 10.5, 10.5, 8.5, 13.5, 14.5, 14.5, 14.5, 14.5,
14.5, 14.5, 10, 10, 10, 11, 10, 8.5, 8.5, 8.5, 8.5, 8.5,
8.5, 8.5, 9.5, 9.5, 9.5, 9.5, 9.5, 8, 9, 9, 9, 9, 9, 4, 10,
10, 10, 10, 10, 10.5, 10.5, 10.5, 10, 10, 8.5, 9.5, 9.5,
9.5, 9.5, 9.5, 4, 10, 10, 10, 10, 10, 8.5, 9, 9, 9, 9, 9,
4, 9.5, 9.5, 9.5, 9.5, 9.5, 4, 7, 13, 13, 13, 13, 13, 13,
10.5, 11, 10.5, 10.5, 10.5, 4, 7, 11, 11, 11, 11, 11, 9,
9.5, 9.5, 9.5, 9.5, 9.5, 8.5, 9, 9, 9, 9, 9, 8.5, 11, 11,
11, 11, 11, 9, 7, 13, 13, 13, 13, 13, 13, 9.5, 9.5, 9.5,
9.5, 9.5, 8.5, 10, 10, 10, 10, 10, 9.5, 9.5, 9.5, 9.5, 9.5,
4, 9, 9, 9, 9, 9, 8.5, 9, 9, 9, 9, 9, 8.5, 9, 9, 9, 9, 9,
8.5, 9.5, 9.5, 9.5, 9.5, 9.5, 8.5, 9.5, 9.5, 9.5, 9.5, 9.5,
8, 10, 10, 10, 10, 10, 8.5, 9, 9, 9, 9, 9, 8.5, 9.5, 9.5,
9.5, 9.5, 9.5, 4, 9, 9, 9, 9, 9, 4, 6, 13, 13, 13, 13, 13,
12, 6, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 6, 14.5, 14.5,
14.5, 14.5, 14.5, 14.5, 10, 10, 10, 10, 10, 9, 13, 14.5,
14.5, 14.5, 14.5, 14.5, 14.5, 10.5, 10.5, 10.5, 10.5, 10.5,
9.5, 9.5, 9.5, 9.5, 9.5, 8.5, 10, 10, 10, 10, 10, 3, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 4, 9.75, 9.75, 9.75,
9.75, 9.75, 3, 10, 10, 10, 10, 10, 8.5, 10, 10, 10, 10, 10,
8, 9, 9, 9, 9, 9, 4, 9.5, 9.5, 9.5, 9.5, 9.5, 8, 9, 9, 9,
9, 9, 4, 10, 10, 10, 10, 10, 4, 9, 9, 9, 9, 9, 8, 9.5, 9.5,
9.5, 9.5, 9.5, 4, 12, 12, 12, 12, 12, 12, 12, 9.5, 9.5, 9.5,
9.5, 9.5, 4, 10, 10, 10, 8, 10, 8, 10, 10, 10, 10, 10, 9,
9, 9, 9, 9, 8.5, 10.5, 10.5, 10.5, 10.5, 10.5, 4, 10.5, 10.5,
10.5, 10.5, 10.5, 10, 10, 10, 10, 10, 9.5, 9.5, 9.5, 9.5,
9.5, 4, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5, 9.5,
8, 9, 9, 9, 9, 9, 8, 6, 12, 12, 12, 12, 12, 12, 6, 14.5,
14.5, 14.5, 14.5, 14.5, 14.5, 6, 12.5, 12.5, 12.5, 12.5,
12.5, 12, 6, 14.5, 14.5, 14.5, 14.5, 14.5, 14.5, 6, 14.5,
14.5, 14.5, 14.5, 14.5, 14.5, 9.5, 9.5, 9.5, 9.5, 9.5, 9,
9, 9, 9, 9, 10, 10, 10, 10, 10, 3.5, 8.5, 8.5, 8.5, 8.5,
4, 9, 9, 9, 8.5, 9, 4, 9.5, 9.5, 9.5, 9.5, 9.5, 4, 9.5, 9.5,
8.5)), row.names = c(NA, -8658L), class = "data.frame")
Any help/guidance will be grateful
Many thanks
Maybe this tidyverse solution is close to what you want. But I am no sure where Hours variable comes. You can reshape your data to wide and then merge. Here the code, as days are present in both dataframes you can directly merge like this:
library(tidyverse)
#Code
#First reshape df2
merged <- df1 %>% select(StoreNumber,Online,Pressure) %>%
left_join(
df2 %>% pivot_wider(names_from = Day,values_from=Time),
by = c('StoreNumber'='BranchNumber'))
#Replace zeroes
merged <- merged %>% replace(is.na(.),0)
Output:
StoreNumber Online Pressure MON TUE WED
1 1 0.2 50 7.5 6 8.5
2 2 0.8 20 0.0 0 0.0
3 3 1.2 10 2.0 1 2.5
Some data used:
#Data 1
df1 <- structure(list(StoreNumber = 1:3, Online = c(0.2, 0.8, 1.2),
Pressure = c(50L, 20L, 10L), MON = c(0L, 0L, 0L), TUE = c(0L,
0L, 0L), WED = c(0L, 0L, 0L), SUN = c(0L, 0L, 0L)), class = "data.frame", row.names = c(NA,
-3L))
#Data 2
df2 <- structure(list(BranchNumber = c(1L, 1L, 1L, 3L, 3L, 3L), Day = c("MON",
"TUE", "WED", "MON", "TUE", "WED"), Time = c(7.5, 6, 8.5, 2,
1, 2.5)), class = "data.frame", row.names = c(NA, -6L))