Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work without tidyverse loaded #12

Closed
krassowski opened this issue Dec 19, 2020 · 7 comments
Closed

Does not work without tidyverse loaded #12

krassowski opened this issue Dec 19, 2020 · 7 comments

Comments

@krassowski
Copy link

I get various errors when trying to use the package by itself wit ggplot2 loaded, for example:

  • Error in data %>% select_if(is.logical) %>% names: could not find function "%>%"
  • could not find function "as_tibble"

They go away if I explicitly load entire tidyverse (library(tidyverse)) which is a thing I would prefer to avoid. Wold you please consider declaring the imports that you use, e.g. with @importFrom or manual NAMESPACE curation?

Also, would you consider submitting the package for CRAN? I think it has a great potential because it has the cleanest API from several R packages implementing venn diagrams I looked at.

@yanlinlin82
Copy link
Owner

Thank you very much! I'd like to improve the package and submit it to CRAN as you suggested.

@yanlinlin82
Copy link
Owner

Hi @krassowski , would you please tell me more details about your using the package without explicitly loading tidyverse? Because I failed to reproduce the error you mentioned.

Here goes my test:

$ R

R version 4.0.2 (2020-06-22) -- "Taking Off Again"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[Previously saved workspace restored]
> ls()
[1] "a"
> a  # the only variable
$`Set 1`
[1] 1 3 5 7 9

$`Set 2`
[1]  1  5  9 13

$`Set 3`
[1] 1 2 8 9

$`Set 4`
[1]  6  7 10 12

> search()  # there are only basic packages
[1] ".GlobalEnv"        "package:stats"     "package:graphics"  "package:grDevices" "package:utils" 
[6] "package:datasets"  "package:methods"   "Autoloads"   "package:base"     
> library(ggvenn)  # when loading `ggvenn`, it will automatically load `dplyr`, `grid` & `ggplot2`
Loading required package: dplyr

Attaching package:dplyrThe following objects are masked frompackage:stats:

    filter, lag

The following objects are masked frompackage:base:

    intersect, setdiff, setequal, union

Loading required package: grid
Loading required package: ggplot2
> a %>% ggvenn(c("Set 1", "Set 2"))  # all things go right
>

By the way, I just submitted a new commit, which added some @importFrom declarations. Could you have a try to see if it solve your problem or not? Thank you!

@krassowski
Copy link
Author

For reproduction of the issue use:

df = data.frame(
    'set a'=c(TRUE, FALSE, TRUE, TRUE),
    'set b'=c(TRUE, TRUE, TRUE, TRUE),
    'set c'=c(FALSE, TRUE, FALSE, FALSE),
    'set d'=c(FALSE, FALSE, FALSE, TRUE),
    check.names=FALSE
)


ggvenn::ggvenn(df)

I will check the new version later.

@yanlinlin82
Copy link
Owner

Thanks. I can reproduce the error now. I will work on it.

@yanlinlin82
Copy link
Owner

The latest commit should be ok now. @krassowski

@krassowski
Copy link
Author

Works fine for me indeed. Thank you!

@yanlinlin82
Copy link
Owner

Also, would you consider submitting the package for CRAN? I think it has a great potential because it has the cleanest API from several R packages implementing venn diagrams I looked at.

Finally, I have submit 'ggvenn' to CRAN, and it could be installed by 'install.packages("ggvenn")' now. Thank you for your suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants