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

dev_help now requires non-installed package #458

Closed
klmr opened this Issue Apr 14, 2014 · 5 comments

Comments

Projects
None yet
3 participants
@klmr
Contributor

klmr commented Apr 14, 2014

As of release 1.5, dev_help (and ?) on R 3.0.2 (OS X 10.9.2) show the following error:

Error in loadNamespace(name) : there is no package called ‘rstudioapi’

Installing the package manually fixes the problem – but I’m actually not using R Studio, so maybe this package shouldn’t be required to begin with (that said, I don’t see the harm of requiring the package either).

@hadley

This comment has been minimized.

Member

hadley commented Apr 14, 2014

The whole point of rstudioapi is that you don't need rstudio installed.

@wch I think this means that rstudioapi should be in imports, not suggest.

@wch

This comment has been minimized.

Member

wch commented Apr 14, 2014

@hadley We could put the rstudioapi in imports, but I think it shouldn't be hard to structure the code to avoid attempts to load rstudioapi.

@klmr Can you include a traceback for the error? I'm curious to see where it's trying to load the package.

@hadley

This comment has been minimized.

Member

hadley commented Apr 14, 2014

I'm pretty sure rstudioapi belongs in imports, because the goal of the package is abstract away code which checks if rstudio is running. Adding extra code to check if rstudioapi is installed sort of defeats the purpose. (The check is probably coming from inside dev_help()

@hadley hadley closed this Apr 14, 2014

@hadley hadley reopened this Apr 14, 2014

@klmr

This comment has been minimized.

Contributor

klmr commented Apr 14, 2014

@wch Here you go:

> traceback()
11: stop(e)
10: value[[3L]](cond)
9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
8: tryCatchList(expr, classes, parentenv, handlers)
7: tryCatch(loadNamespace(name), error = function(e) stop(e))
6: getNamespace(ns)
5: asNamespace(ns)
4: getExportedValue(pkg, name)
3: rstudioapi::hasFun
2: dev_help(e1_str)
1: `?`(test)
@wch

This comment has been minimized.

Member

wch commented Apr 14, 2014

@hadley OK, that makes sense.

@klmr Thanks, my version was slightly outdated so I didn't have that code path.

@hadley hadley closed this in ac651aa Jun 26, 2014

@lock lock bot locked and limited conversation to collaborators Sep 18, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.