Hey all,
I have joined two dataframes together and I am trying to select only the 'Branch Codes' that are duplicated.
However, the last line of the code below does not seem to work!
BranchData$'Branch Code' <- as.numeric(BranchData$'Branch Code')
BranchCalls$'Branch Code' <- as.numeric(BranchCalls$'Branch Code')
BranchData <- na.omit(BranchData)
merged <- full_join(BranchData,BranchCalls)
merged <- merged %>% group_by(merged$`Branch Code`) %>% filter(n() >= 2)
Also, when I try to put the duplicates into groups, so that all the duplicates are together, but the following code doesn't seem to work!:
merged <- group_by(merged,merged
$'Branch Code')
Minimal Reproducible Example:
`Branch Code` `Location Type` Type Status Segment `Multiple (partn…` RetailType `Volume of tra…` `Open hours` `X Pos` `Y Pos`
<dbl> <chr> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
1 401801 Urban MAIN Open Agency Multiple 11 Books_Sta… 2238 47.7 394169 806326
2 436801 Urban MAIN Open Agency Multiple 11 Books_Sta… 1514 50.3 393488 805877
3 403801 Urban Deprived MAIN Open Agency Multiple 12 Convenien… 1346 46.5 394434 804347
4 164801 Rural MAIN Open Agency Multiple 13 Convenien… 1338 48.3 392153 796902
5 198801 Urban LM Open Agency Multiple 13 Convenien… 625 114. 393094 802789
6 442801 Rural LM Open Agency Multiple 9 Convenien… 588 40.3 383644 800648
#
I would be so grateful if anybody could give me a helping hand!
Thank you so much!