Question

I have run into very weird side effects when using devtools functions. Here is a simple example. Basically, I start a clean R session, create an empty package and then use load_all to load the new package. Once I have done that, the help function doesnt work anymore. Here is screen capture:

R version 3.1.0 (2014-04-10) -- "Spring Dance"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-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.

> setwd("c:/Scratch")
> require(devtools)
Loading required package: devtools

Attaching package: ‘devtools’

The following objects are masked from ‘package:utils’:

    ?, help

The following object is masked from ‘package:base’:

    system.file

> help("data.frame")
starting httpd help server ... done
> create("mypackage",rstudio=F)
Creating package mypackage in .
No DESCRIPTION found. Creating with values:

Package: mypackage
Title: What the package does (short line)
Version: 0.1
Authors@R: "First Last <first.last@example.com> [aut, cre]"
Description: What the package does (paragraph)
Depends: R (>= 3.1.0)
License: What license is it under?
LazyData: true
> help("data.frame")
> load_all("mypackage")
Loading mypackage
> help("data.frame")
Error in names(t1) <- rep(names(L), lapply(L, length)) : 
  attempt to set an attribute on NULL
> 

Here is the session info:

> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: i386-w64-mingw32/i386 (32-bit)


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

other attached packages:
[1] mypackage_0.1 devtools_1.5 

loaded via a namespace (and not attached):
[1] digest_0.6.4   evaluate_0.5.5 httr_0.3       memoise_0.2.1  parallel_3.1.0 RCurl_1.95-4.1 stringr_0.6.2  tools_3.1.0    whisker_0.3-2 
> 

The help command not working is just an example, there are some really other strange stuff I noticed. Like data.table subsetting function not working anymore. I would appreciate if you could give me some pointers how you to attack the problem.

Was it helpful?

Solution

This is a bug in devtools 1.5 which happens when a project has no help files. I just pushed a fix.

On non-Windows platforms, you can update to the latest version with devtools::install_github('hadley/devtools'). On Windows, see ?build_github_devtools for instructions on how to update.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top