Go to TogaWare.com Home Page. Data Science Desktop Survival Guide
by Graham Williams
Duck Duck Go

Tee Pipe Alternatives

Raw We could simply base::print() the value of the variable no.rain after the assignment or else enclose the assignment within round brackets but there is some elegance in including it explicitly as part of the single pipeline.
# Equivalent alternatives to the above tee-pipe example.

(
  weatherAUS %>%
    filter(Rainfall==0) ->
  no.rain
)
## # A tibble: 112,447 x 24
##    Date       Location MinTemp MaxTemp Rainfall Evaporation Sunshine
##    <date>     <chr>      <dbl>   <dbl>    <dbl>       <dbl>    <dbl>
##  1 2008-12-02 Albury       7.4    25.1        0          NA       NA
##  2 2008-12-03 Albury      12.9    25.7        0          NA       NA
##  3 2008-12-04 Albury       9.2    28          0          NA       NA
....

print(no.rain)
## # A tibble: 112,447 x 24
##    Date       Location MinTemp MaxTemp Rainfall Evaporation Sunshine
##    <date>     <chr>      <dbl>   <dbl>    <dbl>       <dbl>    <dbl>
##  1 2008-12-02 Albury       7.4    25.1        0          NA       NA
##  2 2008-12-03 Albury      12.9    25.7        0          NA       NA
##  3 2008-12-04 Albury       9.2    28          0          NA       NA
....


Support further development by purchasing the PDF version of the book.
Other online resources include the GNU/Linux Desktop Survival Guide.
Books available on Amazon include Data Mining with Rattle and Essentials of Data Science.
Popular open source software includes rattle and wajig.
Hosted by Togaware, a pioneer of free and open source software since 1984.
Copyright © 2000-2020 Togaware Pty Ltd. . Creative Commons ShareAlike V4.