I create a new package with RStudio. In "Configure Build Tools", I check "Generate documentation with Roxygen".
The first time I click on "Document" in the "Build" pane, everything works fine:
==> roxygen2::roxygenize('.', roclets=c('rd', 'collate', 'namespace'))
First time using roxygen2. Upgrading automatically...
Writing hello.Rd
Writing NAMESPACE
Documentation completed
I get this NAMESPACE:
# Generated by roxygen2: do not edit by hand
export(hello)
and this file hello.Rd
:
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hello.R
\name{hello}
\alias{hello}
\title{Hello}
\usage{
hello(x)
}
\arguments{
\item{x}{string}
}
\value{
a string
}
But now, I modify the file hello.R
, and then I get two problems.
Firstly, this window appears:
If I click on "Yes", nothing happens.
Secondly, it seems that roxygen2
cannot overwrite hello.Rd
, because I get this text in the "Build" pane:
==> roxygen2::roxygenize('.', roclets=c('rd', 'collate', 'namespace'))
Error: The specified file is not readable: U:\Data\Rtests\testPackage\man/hello.Rd
Execution halted
Exited with status 1.
The only way I found to update the documentation is to run:
roxygen2::roxygenize(clean=TRUE)
This command firstly cleans everything, the NAMESPACE and the Rd
files, and then generates the NAMESPACE and the Rd
files.
I don't know whether this is an issue with the path of Rtools
. I tried to set the path by doing:
Sys.setenv(PATH="%PATH%;C:/Program Files/Rtools/gcc-4.6.3/bin;C:/Program Files/Rtools/gcc-4.6.3/bin64;C:/Program Files/Rtools/gcc-4.6.3/i686-w64-mingw32/bin;C:/Program Files/Rtools/bin")
But that does not solve the issue.
I'm using:
roxygen2 5.0.1
RStudio 0.99.892
Windows 7
R version 3.3.1