ProjectMOSAIC / mosaic

Project MOSAIC R package
http://mosaic-web.org/
93 stars 26 forks source link

package startup messages #763

Open nicholasjhorton opened 4 years ago

nicholasjhorton commented 4 years ago

Are there ways to do some light pruning on the mosaic startup messages? It's a low priority query but it's been bugging me.

> library(mosaic)
Loading required package: dplyr

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

Loading required package: lattice
Loading required package: ggformula
Loading required package: ggplot2
RStudio Community is a great place to get help:
https://community.rstudio.com/c/tidyverse
Loading required package: ggstance

Attaching package: ‘ggstance’

The following objects are masked from ‘package:ggplot2’:

    geom_errorbarh, GeomErrorbarh

New to ggformula?  Try the tutorials: 
    learnr::run_tutorial("introduction", package = "ggformula")
    learnr::run_tutorial("refining", package = "ggformula")
Loading required package: mosaicData
Loading required package: Matrix
Registered S3 method overwritten by 'mosaic':
  method                           from   
  fortify.SpatialPolygonsDataFrame ggplot2

The 'mosaic' package masks several functions from core packages in order to add 
additional features.  The original behavior of these functions should not be affected by this.

Note: If you use the Matrix package, be sure to load it BEFORE loading mosaic.

Have you tried the ggformula package for your plots?

Attaching package: ‘mosaic’

The following object is masked from ‘package:Matrix’:

    mean

The following object is masked from ‘package:ggplot2’:

    stat

The following objects are masked from ‘package:dplyr’:

    count, do, tally

The following objects are masked from ‘package:stats’:

    binom.test, cor, cor.test, cov, fivenum, IQR, median, prop.test, quantile, sd,
    t.test, var

The following objects are masked from ‘package:base’:

    max, mean, min, prod, range, sample, sum

All I can really see as fully redundant is the "Have you tried the ggformula package for your plots?" since the tutorials are plugged.

Perhaps consider the way that the tidyverse package reports masking?

> library(tidyverse)
── Attaching packages ─────────────────────────────────────────────────────────────────── tidyverse 1.3.0 ──
✓ tibble  3.0.1     ✓ purrr   0.3.4
✓ tidyr   1.1.0     ✓ stringr 1.4.0
✓ readr   1.3.1     ✓ forcats 0.5.0
── Conflicts ────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
x mosaic::count()            masks dplyr::count()
x purrr::cross()             masks mosaic::cross()
x mosaic::do()               masks dplyr::do()
x tidyr::expand()            masks Matrix::expand()
x dplyr::filter()            masks stats::filter()
x ggstance::geom_errorbarh() masks ggplot2::geom_errorbarh()
x dplyr::lag()               masks stats::lag()
x tidyr::pack()              masks Matrix::pack()
x mosaic::stat()             masks ggplot2::stat()
x mosaic::tally()            masks dplyr::tally()
x tidyr::unpack()            masks Matrix::unpack()

Note that the colors used by the tidyverse package are less jarring for novice and experienced users.

Screen Shot 2020-07-13 at 9 27 56 AM

rpruim commented 4 years ago

The way tidyverse does this is a based on a lot of functions that tidyverse doesn't export, and some appear to be hard-coded for tidyverse rather than provided as general functions that could work for package.

But perhaps I can tweak our zzz.R to improve this a bit.

rpruim commented 4 years ago

OK. I think I can greatly reduce the visual clutter if we

Might also want to

I'm doing some experimenting. Stay tuned.

rpruim commented 4 years ago

Still WIP, but here is what I currently have locally.

> library(mosaic)
Registered S3 method overwritten by 'mosaic':
  method                           from   
  fortify.SpatialPolygonsDataFrame ggplot2

The 'mosaic' package masks several functions from core packages in order to add 
additional features.  The original behavior of these functions should not be affected by this.

Attaching package: ‘mosaic’

The following objects are masked from ‘package:dplyr’:

    count, do, tally

The following object is masked from ‘package:Matrix’:

    mean

The following object is masked from ‘package:ggplot2’:

    stat

The following objects are masked from ‘package:stats’:

    binom.test, cor, cor.test, cov, fivenum, IQR, median, prop.test, quantile, sd, t.test, var

The following objects are masked from ‘package:base’:

    max, mean, min, prod, range, sample, sum
rpruim commented 4 years ago

@nicholasjhorton: Do we want to reinstate any of our previous messages (pointers to tutorials, mention of ggformula, etc.) or leave as is?

nicholasjhorton commented 3 years ago

I now wonder whether the pointers to tutorials would be good to add back. But I'm pleased that things are slightly less chatty. Thanks!

rpruim commented 3 years ago

For the tutorials, do you mean the ggformula tutorials? If so, we should fix that in ggformula, not here. Did we have a turorial pitch for mosaic proper?

nicholasjhorton commented 3 years ago

I don't think that we have one for mosaic, but the ggformula one is pretty close.