[inlinedocs] Error in 'modify.Rd.file' on '[.' S3 methods

Julien Moeys julien.moeys at slu.se
Thu Nov 29 16:39:04 CET 2012


Dear all

It seems that package.skeleton.dx() is giving an error when processing an S3 method for '[.'

(an example of such method is "[.data.frame", to subset a data.frame object)

I made a small reproducible example that illustrate my problem

## R code --- --- ---

"[.dummyDf" <- function(# Some title
### A more detailed description
 x, 
### Some description
 i, 
### More description
 j
){  
    class( x ) <- "data.frame"
    return( x[ i, j ] )
### Returns something
}      

# tmp <- data.frame(A=1:10,B=11:20)
# tmp[ 1, ] 
# class( tmp ) <- "dummyDf" 
# tmp[ 1, ]

## End of R code --- --- ---

When I include this function in a small dummy package, made for the purpose, and I run package.skeleton.dx(), I have the following message:
--- --- ---
Creating directories ...
Creating DESCRIPTION ...
[..snip...]
Modifying files automatically generated by package.skeleton:
[.dummyDf:Error in parse(text = utxt) : <text>:2:1: unexpected '['
1: 
2: [
  ^
--- --- ---

And a traceback() after that error gives:
3: parse(text = utxt)
2: modify.Rd.file(N, name, docs)
1: package.skeleton.dx(pkgdir = file.path(pkg.dir, pkg.name), namespace = TRUE)

The beginning of the file " z[.dummyDf.Rd " is 
--- --- ---
\name{[.dummyDf}

\alias{[.dummyDf}

\title{Some title}

\description{A more detailed description}
--- --- ---

The error is not occurring in inlinedocs 1.8, but it does in 1.9.1 (both on Win 7 64 bits and Win XP 32 bits)

I would be glad to fix the error myself, but I must admit it is difficult for me to understand all the text processing going on in 'modify.Rd.file'. Someone has an idea of what may cause the problem?

Any help would be appreciated. No hurry, I can still compile and use inlinedocs 1.8

All the best 

/Julien

PS: My sessionInfo():
R version 2.15.2 (2012-10-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=Swedish_Sweden.1252  LC_CTYPE=Swedish_Sweden.1252    LC_MONETARY=Swedish_Sweden.1252
[4] LC_NUMERIC=C                    LC_TIME=Swedish_Sweden.1252    

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

other attached packages:
[1] rcmdwrapper_1.02 inlinedocs_1.9.1

loaded via a namespace (and not attached):
[1] tools_2.15.2



More information about the Inlinedocs-support mailing list