r - roxygen2 + cygwin + default parameter = truncated `\usage` section -
i have package r i've been developing under linux, , horrible time has come i'm testing under windows.
the documentation done using roxygen, , using cygwin build package.
the thing is, when roxygenise('test-package')
, roxygen truncates \usage
section of documentation 1 character. not of functions, , can't figure out pattern.
this not occur when run same command (i.e. roxygenise('test-package')
r prompt) under linux or windows - cygwin under windows (using r devtools + command prompt windows isn't option me - it's part of big project makefiles etc).
in cases, using roxygen v2.2.2.
update:
this appears occur function default parameter.
i've boiled down 1 reproducible example, trimmed down as possible isolate problem:
from r:
# function used trim strings, i've stripped right down # eliminate cause of problem trim <- function(x='asdf') { return( x ) } package.skeleton('test')
modify
trim.r
(in test/r) , add following roxygen top, file looks like:#' trim white spaces string #' #' @param x string or vector of strings trim #' @return x trimmed. #' @export trim <- function(x='asdf') { return( x ) }
run r , generate documentation:
library(roxygen2) roxygenise('test')
look @ resulting
trim.rd
file (in test/man):\name{trim} \alias{trim} \title{trim white spaces string} \usage{ t } \arguments{ ... # rest of .rd file - nothing wrong here.
see how there's \usage{t}
??
of course, when 1 runs r cmd check
1 gets error documented arguments not appearing in \usage
, that's because \usage
got truncated.
does know why occurs , how can work around it? perhaps in roxygen2
relies on works in mac, windows & linux not cygwin?
cheers (i've been tearing hair out on this).
update #2:
i have been using r installed cygwin's package manager, opposed windows r (ie 1 in c:/program files/r/r-2.14.2/bin
) - didn't realise windows r work under cygwin.
if use windows r in cygwin, bug goes away. if use cygwin r in cygwin, bug present.
i can assume bug related cygwin r, opposed roxygen2.
for use workaround of using windows r within cygwin (in fact, know can this, there's no need cygwin r anyway!).
this not fix, workaround.
i have been using r installed cygwin's package manager, opposed windows r (ie 1 in c:/program files/r/r-2.14.2/bin) - didn't realise windows r work under cygwin.
if use windows r in cygwin, bug goes away. if use cygwin r in cygwin, bug present.
i can assume bug related cygwin r, opposed roxygen2.
for use workaround of using windows r within cygwin (in fact, know can this, there's no need cygwin r anyway). still gives me access linux commands make
, sed
, grep
, allows me documentation working.
the problem still remains cygwin-r in cygwin (not windows-r in cygwin) causes bug, perhaps not related roxygen2 more.
Comments
Post a Comment