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

Conflict with shiny "em" function (="em" html tag) #8

Closed
juliendiot42 opened this issue May 5, 2018 · 5 comments
Closed

Conflict with shiny "em" function (="em" html tag) #8

juliendiot42 opened this issue May 5, 2018 · 5 comments

Comments

@juliendiot42
Copy link

Hi !
The "em" function of the package can be in conflict with the corresponding function from the "shiny" package.
see commit of Apr 5, 2018 : minor improvement to em()

It is not very important but it can raise an error, witch is a bit hard to find, in some shiny app.

@timflutre
Copy link
Owner

Let's say there are two functions "myfunc", one from package "pkgA" and one fro package "pkgB". Let's also say that we are writing a Shiny interface importing both packages. There is no conflict as long as one uses the following syntax:

myvar1 <- pkgA::myfunc()
myvar2 <- pkgB::myfunc()

Therefore, I won't change the "em" function from the "rutilstimflutre" package. In fact, one should rather use shiny::em(...) in the Shiny interface. This also makes me think that it could be better to transform the current Shiny interface into a proper R package (see issue 8).

@timflutre
Copy link
Owner

Hi @juliendiot42 ! For your information, in the latest release (0.160.5), I renamed the em function into em_solve. But this is not a reason to ignore issue #11 of PlantSelBreedGame ;)

@juliendiot42
Copy link
Author

Hi !
Good, I think it's better. Even if it's possible to manage easily this kind of issue, most people don't use the syntax pkg::function() very often, just to when conflicts appear.

Another method to handle this kind of conflict is to pay attention to the order of the packages loading. The last package overwrite the functions of the previous one in the global environment. By this way, it's possible to manage the "priority" of each packages.

For the issue #11, of course it's not a reason ( but it will be a long and boring task to do 😆 )

@timflutre
Copy link
Owner

Caution, the ONLY way of taking care of this thing when developing a package is to use the syntax pkg::function(). It's cumbersome but compulsory, otherwise R CMD check returns an error.

@juliendiot42
Copy link
Author

Ok, thank you !

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