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

7,681 views
Skip to first unread message

mccr...@gmail.com

unread,
Jan 16, 2015, 3:41:04 PM1/16/15
to rdev...@googlegroups.com
Hi all-

I'm having issues with looking at my documentation in RStudio. I think this might be a bug where rstudioapi is referred to as rstudio? I'm really not sure. BUT if I do this on command line, i see the documentation properly. So there's that...

Thanks,

James

RSTUIDO
Restarting R session...


> library(devtools)


> document()
Updating rwrfhydro documentation
Loading rwrfhydro


> VisualizeDomain
function(file, variable=NULL) {
....
}
<environment: namespace:rwrfhydro>


> ?VisualizeDomain
Error in loadNamespace(name) : there is no package called rstudio


Enter a frame number, or 0 to exit  


 
1: `?`(VisualizeDomain)
 
2: dev_help(e1_str)
 
3: rstudioapi::hasFun("previewRd")
 
4: exists(name, envir = asNamespace("rstudio"), ...)
 
5: asNamespace("rstudio")
 
6: getNamespace(ns)
 
7: tryCatch(loadNamespace(name), error = function(e) stop(e))
 
8: tryCatchList(expr, classes, parentenv, handlers)
 
9: tryCatchOne(expr, names, parentenv, handlers[[1]])
10: value[[3]](cond)


Selection: 0

> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rwrfhydro_0.1.0 devtools_1.6.1 

loaded via a namespace (and not attached):
 [1] colorspace_1.2-4    digest_0.6.8        ggmap_2.3           ggplot2_1.0.0       grid_3.1.2          gtable_0.1.2        lubridate_1.3.3     mapproj_1.2-2       maps_2.3-9         
[10] MASS_7.3-35         memoise_0.2.1       munsell_0.4.2       ncdf4_1.13          packrat_0.4.2-1     plyr_1.8.1          png_0.1-7           proto_0.3-10        Rcpp_0.11.3        
[19] reshape2_1.4.1      RgoogleMaps_1.2.0.6 rjson_0.2.15        RJSONIO_1.3-0       roxygen2_4.1.0      rstudioapi_0.2      scales_0.2.4        stringr_0.6.2       tools_3.1.2  

COMMAND LINE

> devtools::load_all()

Loading rwrfhydro

> ?VisualizeDomain

VisualizeDomain           package:rwrfhydro            R Documentation

...

 END



Hadley Wickham

unread,
Jan 16, 2015, 4:09:08 PM1/16/15
to James McCreight, rdev...@googlegroups.com
Maybe try install.packages("rstudioapi")

Hadley
> --
> You received this message because you are subscribed to the Google Groups
> "devtools" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rdevtools+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
http://had.co.nz/

James McCreight

unread,
Jan 16, 2015, 4:20:27 PM1/16/15
to Hadley Wickham, rdev...@googlegroups.com
Thanks Hadley-

It's installed as per the sessionInfo output. I also tried loading rstudioapi and get the same result.

library(devtools)
> library(rstudioapi)
> document()
Updating rwrfhydro documentation
Loading rwrfhydro
> ?VisualizeDomain
Error in loadNamespace(name) : there is no package called ‘rstudio’

Enter a frame number, or 0 to exit   

 1: `?`(VisualizeDomain)
 2: dev_help(e1_str)
 3: rstudioapi::hasFun("previewRd")
 4: exists(name, envir = asNamespace("rstudio"), ...)
 5: asNamespace("rstudio")
 6: getNamespace(ns)
 7: tryCatch(loadNamespace(name), error = function(e) stop(e))
 8: tryCatchList(expr, classes, parentenv, handlers)
 9: tryCatchOne(expr, names, parentenv, handlers[[1]])
10: value[[3]](cond)
--
-
******************************************************************************
James McCreight                               
cell: (831) 261-5149
office: (303) 497-8404
VoIP (to cell): (720) 432-2166 

Hadley Wickham

unread,
Jan 16, 2015, 4:25:37 PM1/16/15
to James McCreight, rdev...@googlegroups.com
In that case, I'd next try upgrading your RStudio. What version do you
currently have?
Hadley
--
http://had.co.nz/

James McCreight

unread,
Jan 18, 2015, 10:09:23 PM1/18/15
to rdev...@googlegroups.com

I was using the current release
Version 0.98.1091 – © 2009-2014 RStudio, Inc.
and moved to the preview release
Version 0.99.174 – © 2009-2014 RStudio, Inc.
which resolved the problem.

Thanks Hadley,
James

metaleepc

unread,
Oct 21, 2015, 3:06:20 PM10/21/15
to devtools
I have the same issue, but worked around it by disable "Generate documentation with Roxygen" in Project Options/Build Tools in RStudio.

Dulani

unread,
Jul 21, 2016, 4:16:42 PM7/21/16
to devtools, mccr...@gmail.com
Doh! Just had the same problem.  Can't believe I had to use Google to figure that one out.  I was convinced the package would already be installed when using RSstudio.
Reply all
Reply to author
Forward
0 new messages