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

Depend on methods so Rscript doesn't fail #840

Merged
merged 1 commit into from
May 21, 2015
Merged

Conversation

jcheng5
Copy link
Member

@jcheng5 jcheng5 commented May 21, 2015

No description provided.

@wch
Copy link
Collaborator

wch commented May 21, 2015

IIRC, Rscript can still fail with this change if you call rscript -e shiny::runApp(), because that doesn't cause methods to be attached. In order for methods to be attached, you need to do library(shiny). Let me dig up the relevant mailing list threads.

@yihui
Copy link
Member

yihui commented May 21, 2015

That is what I have not finished typing in shiny-discuss...

@wch
Copy link
Collaborator

wch commented May 21, 2015

@jcheng5
Copy link
Member Author

jcheng5 commented May 21, 2015

Yeah, but we call library(shiny) in shiny::runApp(). It seems to work...?

@wch
Copy link
Collaborator

wch commented May 21, 2015

Oh, I suppose that's true. Do you mind putting a comment in there somewhere that explains why methods is needed, and why this works? Otherwise we'll keep getting confused about it.

@jcheng5 jcheng5 force-pushed the joe/bugfix/methods-depend branch from 503b8c0 to 15af660 Compare May 21, 2015 16:56
@jcheng5
Copy link
Member Author

jcheng5 commented May 21, 2015

OK done.

@wch
Copy link
Collaborator

wch commented May 21, 2015

Awesome. Looks good to me.

jcheng5 added a commit that referenced this pull request May 21, 2015
Depend on methods so Rscript doesn't fail
@jcheng5 jcheng5 merged commit 8d7752b into master May 21, 2015
@jcheng5 jcheng5 deleted the joe/bugfix/methods-depend branch May 21, 2015 16:57
@yihui
Copy link
Member

yihui commented May 21, 2015

IMHO the best solution is to use a hack in .onAttach/.onLoad: x <- 'methods'; library(x, character.only = TRUE) This will shut up R CMD check, and makes sure methods is always attached.

I vaguely remember even Depends: methods + import(methods) won't work in certain cases. Let me see if I can still find such a case.

@jcheng5
Copy link
Member Author

jcheng5 commented May 21, 2015

Fine but let's try not to bikeshed too hard on this, it doesn't seem like an issue that's worth much more of our time/energy.

@yihui
Copy link
Member

yihui commented May 21, 2015

Okay I'll let it go then :)

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

Successfully merging this pull request may close these issues.

3 participants