Re: [R-pkg-devel] R CMD build: "Error in if (any(update))"

2019-06-11 Thread Rob Foxall
Thanks for the replies. I am still stuck, although agree it is most
likely due to change to R version 3.6.0. I did however manage to
create a dummy package that now does re-create the same error, this
required the inclusion of a data object. The R CMD build error occurs
regardless of whether there is a sysdata.rda in the R subdirectory,
and whether there is a datalist in the data subdirectory. Apologies
for the lengthy "code" that follows:

In R:
myCol <- rgb(0.9,0.5,0.5)
myPlot <- function(x){
   plot(x, col = myCol)
   return(NULL)
}
package.skeleton(name = "myPackage", list = c("myPlot", "myCol"))

"Optionally" in R:
save(list = c("myCol"), file = "sysdata.rda")

my DESCRIPTION file:
Package: myPackage
Type: Package
Title: Test Package
Version: 1.0
Date: 2019-06-11
Author: Rob Foxall 
Maintainer: Rob Foxall 
Description: To test making a package
License: GPL-2
LazyLoad: yes

my NAMESPACE file:
exportPattern("^[[:alpha:]]+")

contents of myPackage directory:
directories "data", "man", "R", files "DESCRIPTION", "NAMESPACE",
"Read-and-delete-me"
contents of data subdirectory:
myCol.rda, (optionally) datalist
contents of man subdirectory:
myCol.Rd, myPackage-package.Rd, myPlot.Rd
contents of R subdirectory:
myPlot.R, ("optionally") sysdata.rda

The ".Rd" files:
myCol.Rd:
\name{myCol}
%
\alias{myCol}
%
\docType{data}
%
\title{A colour}
%
\description{It's a colour}
%
\usage{data(myCol)}
%
\format{
It is a colour, defined by:
rgb(red=0.9,green=0.5,blue=0.5)
}
%
\details{
Other, standard colours are available via sensible names. See \code{colours}. }
%
\source{See Me}
%
\references{Albers, J. (1975) \emph{Interaction of Colour}. Yale
University Press}
%
\examples{
myPlot(3)
}
%
\keyword{sysdata}

myPackage-package.Rd:
\name{myPackage-package}
%
\alias{myPackage-package}
%
\alias{myPackage}
%
\docType{package}
%
\title{Test package}
%
\description{Testing making a package}
%
\details{
\tabular{ll}{
Package: \tab myPackage\cr
Type: \tab Package\cr
Version: \tab 1.0\cr
Date: \tab 2019-06-11\cr
License: \tab GPL-2\cr
LazyLoad: \tab yes\cr
}
%
Test package, dummy plot with dummy colour
}
%
\author{
Rob Foxall 
Maintainer:  
}
%
\references{N.A.J. Hastings, Brian Peacock, Merran Evans (2000)
\emph{Statistical Distributions} John Wiley & Sons Inc}
%
\keyword{package}
%
\seealso{\code{\link{plot}}}
%
\examples{
myplot(3)
}

myPlot.Rd
\name{myPlot}
%
\alias{myPlot}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{Do a plot of a number}
%
\description{Plots a number with a set colour}
%
\usage{myPlot(x)}
%
\arguments{
  \item{x}{A number}
}
%
\details{Plots a number with a colour.}
%
\value{Returns null}
%
\author{Rob Foxall}
%
\note{There is no note}
%
\seealso{\code{\link{plot}}}
%
\examples{myPlot(3)}
%
\keyword{KPI}


On Tue, Jun 11, 2019 at 12:00 AM William Dunlap  wrote:
>
> You might be able to find where the error occurred by putting the following 
> lines in ~/.Rprofile
>
> cat("~/.Rprofile: setting alternate error handler\n")
> options(
> error=quote({
> dump.frames()
> writeLines(c("Stack trace", paste0("  ",names(last.dump}))
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
>
> On Mon, Jun 10, 2019 at 6:38 AM Rob Foxall  wrote:
>>
>> Hi,
>>
>> (Re-posting here as per advice from r-help)
>>
>> I've got an R package that I periodically create in what I assume is
>> an old-fashioned way:
>>
>> Within R: use "package.skeleton"
>> Outside of R: update e.g. .rd files as appropriate
>> Command window: run the following commands
>> R CMD build packageName
>> R CMD check packageName
>> R CMD INSTALL --build packageName
>>
>> I am now getting an error on the R CMD build stage. Initially I had
>> wanted to remove a package dependency (by not passing some functions
>> to package.skeleton and editing my NAMESPACE and DESCRIPTION file
>> appropriately), but on getting the error I tried to revert everything
>> back to my last successful build (Feb 2019), however, the error
>> persisted:
>> R CMD build packageName
>> * checking for file 'packageName/DESCRIPTION' ... OK
>> * preparing 'packageName' :
>> * checking DESCRIPTION meta-information ... OK
>> * checking for LF line-endings in source and make files
>> * checking for empty or unneeded directories
>> * looking to see if a 'data/datalist' file should be added
>> Error in if (any(update)) { : missing value where TRUE/FALSE needed
>> Execution halted
>>
>> I am guessing that the error could be due to any of the last three
>> lines that don't have an "OK", but I am completely stuck as to how to
>> narrow it down further, and Dr. Google has already failed me.
>>
>> Using R version 3.6.0, R tools version 3.5.0.4 (I don't recall if had
>> different versions previous time I built this package in Feb 2019).
>> Attempt to reproduce error with dummy package failed (i.e. no issues
>> with R CMD build).
>>
>> Cheers,
>> Rob.
>>
>> __
>> R-package-devel@r-project.org mailing list
>> https

Re: [R-pkg-devel] R CMD build: "Error in if (any(update))"

2019-06-11 Thread Rob Foxall
Thanks. I ran in R:
devtools::build("myPackage")
That gave me a warning:
 NB: this package now depends on R (>= 3.5.0)
 WARNING: Added dependency on R >= 3.5.0 because serialized
objects in  serialize/load version 3 cannot be read in older versions
of R.
 File(s) containing such objects: 'myPackage/R/sysdata.rda'
'myPackage/data/myCol.rda'
But it didn't error. I then added the dependency to R >= 3.5.0 to my
DESCRIPTION file, and rerunning devtools::build now executed without
error or warning. However, in the command window "R CMD build
myPackage" still gives same error.
Then in R I ran:
devtools::check("myPackage")
It gave me a genuine error ("myplot" instead of "myPlot" in my
myPackage-package.rda file), and a couple of warnings. All of which I
fixed, and re-running the check gave me 0 errors/warnings/notes.
In the command window, "R CMD build myPackage" still gives the same error.

On Wed, Jun 12, 2019 at 12:46 PM David Hugh-Jones
 wrote:
>
> If you use devtools::check, I think it runs in the original R process, so you 
> might be able to debug the error using eg options(error=recover).
>
> On Wed, 12 Jun 2019 at 02:31, Rob Foxall  wrote:
>>
>> Thanks for the replies. I am still stuck, although agree it is most
>> likely due to change to R version 3.6.0. I did however manage to
>> create a dummy package that now does re-create the same error, this
>> required the inclusion of a data object. The R CMD build error occurs
>> regardless of whether there is a sysdata.rda in the R subdirectory,
>> and whether there is a datalist in the data subdirectory. Apologies
>> for the lengthy "code" that follows:
>>
>> In R:
>> myCol <- rgb(0.9,0.5,0.5)
>> myPlot <- function(x){
>>plot(x, col = myCol)
>>return(NULL)
>> }
>> package.skeleton(name = "myPackage", list = c("myPlot", "myCol"))
>>
>> "Optionally" in R:
>> save(list = c("myCol"), file = "sysdata.rda")
>>
>> my DESCRIPTION file:
>> Package: myPackage
>> Type: Package
>> Title: Test Package
>> Version: 1.0
>> Date: 2019-06-11
>> Author: Rob Foxall 
>> Maintainer: Rob Foxall 
>> Description: To test making a package
>> License: GPL-2
>> LazyLoad: yes
>>
>> my NAMESPACE file:
>> exportPattern("^[[:alpha:]]+")
>>
>> contents of myPackage directory:
>> directories "data", "man", "R", files "DESCRIPTION", "NAMESPACE",
>> "Read-and-delete-me"
>> contents of data subdirectory:
>> myCol.rda, (optionally) datalist
>> contents of man subdirectory:
>> myCol.Rd, myPackage-package.Rd, myPlot.Rd
>> contents of R subdirectory:
>> myPlot.R, ("optionally") sysdata.rda
>>
>> The ".Rd" files:
>> myCol.Rd:
>> \name{myCol}
>> %
>> \alias{myCol}
>> %
>> \docType{data}
>> %
>> \title{A colour}
>> %
>> \description{It's a colour}
>> %
>> \usage{data(myCol)}
>> %
>> \format{
>> It is a colour, defined by:
>> rgb(red=0.9,green=0.5,blue=0.5)
>> }
>> %
>> \details{
>> Other, standard colours are available via sensible names. See 
>> \code{colours}. }
>> %
>> \source{See Me}
>> %
>> \references{Albers, J. (1975) \emph{Interaction of Colour}. Yale
>> University Press}
>> %
>> \examples{
>> myPlot(3)
>> }
>> %
>> \keyword{sysdata}
>>
>> myPackage-package.Rd:
>> \name{myPackage-package}
>> %
>> \alias{myPackage-package}
>> %
>> \alias{myPackage}
>> %
>> \docType{package}
>> %
>> \title{Test package}
>> %
>> \description{Testing making a package}
>> %
>> \details{
>> \tabular{ll}{
>> Package: \tab myPackage\cr
>> Type: \tab Package\cr
>> Version: \tab 1.0\cr
>> Date: \tab 2019-06-11\cr
>> License: \tab GPL-2\cr
>> LazyLoad: \tab yes\cr
>> }
>> %
>> Test package, dummy plot with dummy colour
>> }
>> %
>> \author{
>> Rob Foxall 
>> Maintainer:  
>> }
>> %
>> \references{N.A.J. Hastings, Brian Peacock, Merran Evans (2000)
>> \emph{Statistical Distributions} John Wiley & Sons Inc}
>> %
>> \keyword{package}
>> %
>> \seealso{\code{\link{plot}}}
>> %
>> \examples{
>> myplot(3)
>> }
>>
>> myPlot.Rd
>> \name{myPlot}
>> %
>> \alias{myPlot}
>> %- Also NEED an '\alias' for EACH other topic documented here.
>> \title{Do a plot of a number}
>> %
>> \description{Plots a number with a set colour}
>> %
>> \usage{myPlot(x)}
>> %
>> \arguments{
>>   \item{x}{A number}
>> }
>> %
>> \details{Plots a number with a colour.}
>> %
>> \value{Returns null}
>> %
>> \author{Rob Foxall}
>> %
>> \note{There is no note}
>> %
>> \seealso{\code{\link{plot}}}
>> %
>> \examples{myPlot(3)}
>> %
>> \keyword{KPI}
>>
>>
>> On Tue, Jun 11, 2019 at 12:00 AM William Dunlap  wrote:
>> >
>> > You might be able to find where the error occurred by putting the 
>> > following lines in ~/.Rprofile
>> >
>> > cat("~/.Rprofile: setting alternate error handler\n")
>> > options(
>> > error=quote({
>> > dump.frames()
>> > writeLines(c("Stack trace", paste0("  ",names(last.dump}))
>> >
>> > Bill Dunlap
>> > TIBCO Software
>> > wdunlap tibco.com
>> >
>> >
>> > On Mon, Jun 10, 2019 at 6:38 AM Rob Foxall  wrote:
>> >>
>> >> Hi,
>> >>
>> >> (Re-posting here as per advice from r-help)
>> >>
>> >> I've got an R