As a general rule, if you assign something to an object, the default is not to print.
If you do not finish a pipe with an assignment, it will print.
For example
library(tidyverse)
iris %>%
select(starts_with("Sepal")) %>%
head()
#> Sepal.Length Sepal.Width
#> 1 5.1 3.5
#> 2 4.9 3.0
#> 3 4.7 3.2
#> 4 4.6 3.1
#> 5 5.0 3.6
#> 6 5.4 3.9
Created on 2019-11-06 by the reprex package (v0.3.0)
will print the resulting dataset
But this version
library(tidyverse)
iris %>%
select(starts_with("Sepal")) %>%
head() ->
sepals
Created on 2019-11-06 by the reprex package (v0.3.0)
will not.
But this (with parentheses) will print
library(tidyverse)
(iris %>%
select(starts_with("Sepal")) %>%
head() ->
sepals)
#> Sepal.Length Sepal.Width
#> 1 5.1 3.5
#> 2 4.9 3.0
#> 3 4.7 3.2
#> 4 4.6 3.1
#> 5 5.0 3.6
#> 6 5.4 3.9
Created on 2019-11-06 by the reprex package (v0.3.0)