The R namespace operator, written as a pair of colons (::), calls an exported function from a named package without attaching that package to the search path. For example, colorDF::highlight() both identifies the package and runs highlight(); colorDF must already be installed. section 19.3.1
Highlighting a season in NBA data
After filtering dat2 for George Mikan's records by year, run colorDF::highlight(test4, test4$Year == 1950). The returned table highlights the 1950 row while preserving the grouped NBA records. The same technique supports a one-line comparison of package-qualified functions without first calling library(colorDF). section 19.3.1
dat2 %>% group_by(Year) %>% filter(Player == 'George Mikan*') -> test4 colorDF::highlight(test4, test4$Year == 1950) ## # Tibble (class tbl_df) 6 x 6: ## # Groups: Year [6] ## │Year │Player │Pos │Tm │G │PTS ## 1│1950 │George Mikan*│C │MNL │ 68│ 1865 ## 2│1951 │George Mikan*│C │MNL │ 68│ 1932 ## 3│1952 │George Mikan*│C │MNL │ 64│ 1523 ## 4│1953 │George Mikan*│C │MNL │ 70│ 1442 ## 5│1954 │George Mikan*│C │MNL │ 72│ 1306 ## 6│1956 │George Mikan*│C │MNL │ 37│ 390
Inspect the complete package-qualified highlight call and its highlighted George Mikan output. section 19.3.1
arsenal::comparedf(test4, test5) ## Compare Object ## ## Function Call: ## arsenal::comparedf(x = test4, y = test5) ## ## Shared: 5 non-by variables and 6 observations. ## Not shared: 1 variables and 0 observations. ## ## Differences found in 0/5 variables compared. ## 0 variables compared have non-identical attributes.
Compare the related arsenal::comparedf call, which qualifies another package function on two data sets. section 19.3.1
