Re: [Rd] R CMD check problem with R 3.0.2

2013-10-26 Thread Simon Urbanek
On Oct 25, 2013, at 12:12 PM, Yihui Xie wrote:

> This has been asked s many times that I think it may be a good
> idea for R CMD check to just stop when the user passes a directory
> instead of a tar ball to it, or automatically run R CMD build before
> moving on. In my opinion, sometimes an FAQ and a bug are not entirely
> different.
> 

+1 -- and I'd do the same for R CMD INSTALL. If someone insists, there could be 
--force or something like that for those that really want to work on 
directories despite all the issues with that, but IMHO the default should be 
for both INSTALL and check to bail out if not presented with a file -- it would 
save a lot of people a lot of time spent in chasing ghost issues.

Cheers,
Simon



> Regards,
> Yihui
> --
> Yihui Xie 
> Web: http://yihui.name
> Department of Statistics, Iowa State University
> 2215 Snedecor Hall, Ames, IA
> 
> 
> On Fri, Oct 25, 2013 at 10:37 AM, Sanford Weisberg  wrote:
>> Using SUSE Linux, Windows 32 bit and Windows 64 bit R 3.0.2 , I am unable
>> to use R CMD check successfully.  Here is the Windows 64 bit report:
>> 
>> 
>> Z:\R\source\effects>R CMD check pkg
>> * using log directory 'Z:/R/source/effects/pkg.Rcheck'
>> * using R version 3.0.2 (2013-09-25)
>> * using platform: x86_64-w64-mingw32 (64-bit)
>> * using session charset: ISO8859-1
>> * checking for file 'pkg/DESCRIPTION' ... ERROR
>> Required fields missing or empty:
>>  'Author' 'Maintainer'
>> 
>> The file DESCRIPTION looks like this:
>> 
>> Package: effects
>> Version: 2.3-0
>> Date: 2013/10/22
>> Title: Effect Displays for Linear, Generalized Linear, Multinomial-Logit,
>> Proportional-Odds Logit Models and Mixed-Effects Models
>> Authors@R: c(person("John", "Fox", role = c("aut", "cre"), email = "
>> j...@mcmaster.ca"),
>>person("Sanford", "Weisberg", role = "aut", email = "sa...@umn.edu"),
>>person("Michael", "Friendly", role = "aut", email = "frien...@yorku.ca
>> "),
>>person("Jangman", "Hong", role = "aut"),
>>person("Robert", "Andersen", role = "ctb"),
>>person("David", "Firth", role = "ctb"),
>>person("Steve", "Taylor", role = "ctb"))
>> Depends: lattice, grid, colorspace
>> Suggests: nlme, lme4, MASS, nnet, poLCA, heplots
>> LazyLoad: yes
>> LazyData: yes
>> Description:
>>  Graphical and tabular effect displays, e.g., of interactions, for linear
>>  generalized linear, multinomial-logit, proportional-odds logit models,
>>  mixed-effect models,  polytomous latent-class models and multivariate
>> linear models.
>> License: GPL (>= 2)
>> URL: http://www.r-project.org, http://socserv.socsci.mcmaster.ca/jfox/
>> 
>> The 'Author' and 'Maintainer' fields should be automatically generated.
>> With version 3.0.1, I had no such problem, and my coauthors who use Eciplse
>> and R-studio have no problems with R 3.0.2.  John Fox suggested the
>> following:
>> 
>> When R CMD build creates a package tarball it writes the information from
>> Authors@R into the
>> Author and Maintainer fields. I think that Sandy's
>> problem is produced by checking the package source directory rather than a
>> package source tarball. I use RStudio to check packages, and it
>> automatically builds the tarball first, which is the recommended procedure.
>> R-Forge does that too. Michael uses Eclipse, and if I remember right, it too
>> creates a tarball (but I haven't used it in quite some time).
>> 
>> Is this a bug in R CMD check?
>> 
>> 
>> --
>> Sanford Weisberg, sa...@umn.edu
>> 
>> For undergraduate matters:  underg...@stat.umn.edu
>> University of Minnesota, School of Statistics
>> 312 Ford Hall, 224 Church St. SE, Minneapolis, MN  55455
>> 612-625-8355, FAX 612-624-8868
>> 
>>[[alternative HTML version deleted]]
>> 
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Multivariate time series in R 3 vs R 2

2013-10-26 Thread Gabor Grothendieck
On Wed, Oct 23, 2013 at 2:56 PM, Андрей Парамонов  wrote:
> Hello!
>
> Recently I got report that my package mar1s doesn't pass checks any more on
> R 3.0.2. I started to investigate and found the following difference in
> multivariate time series handling in R 3.0.2 compared to R 2 (I've checked
> on 2.14.0).
>
> Suppose I wish to calculate seasonal component for time series. In case of
> multivariate time series, I wish to process each column independently. Let
> f be a simple (trivial) model of seasonal component:
>
> f <- function(x)
>   return(ts(rep(0, length(x)), start = 0, frequency = frequency(x)))
>
> In previous versions of R, I used the following compact and efficient
> expression to calculate seasonal component:
>
> y <- do.call(cbind, lapply(x, f))
>
> It worked equally good for univariate and multivariate time series:
>
>> R.Version()$version.string
> [1] "R version 2.14.0 (2011-10-31)"
>> t <- ts(1:10, start = 100, frequency = 10)
>>
>> x <- t
>> y <- do.call(cbind, lapply(x, f))
>> y
> Time Series:
> Start = c(0, 1)
> End = c(0, 10)
> Frequency = 10
>  [1] 0 0 0 0 0 0 0 0 0 0
>>
>> x <- cbind(t, t)
>> y <- do.call(cbind, lapply(x, f))
>> y
> Time Series:
> Start = c(0, 1)
> End = c(0, 10)
> Frequency = 10
> t t
> 0.0 0 0
> 0.1 0 0
> 0.2 0 0
> 0.3 0 0
> 0.4 0 0
> 0.5 0 0
> 0.6 0 0
> 0.7 0 0
> 0.8 0 0
> 0.9 0 0
>
> But in version 3, I get some frustrating results:
>
>> R.Version()$version.string
> [1] "R version 3.0.2 (2013-09-25)"
>> t <- ts(1:10, start = 100, frequency = 10)
>>
>> x <- t
>> y <- do.call(cbind, lapply(x, f))
>> y
> Time Series:
> Start = 0
> End = 0
> Frequency = 1
>   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> 0 0
>   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> 0 0
>   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> 0 0
>   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> 0 0
>   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> 0 0
>   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> 0 0
>   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> 0 0
>   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> 0 0
>   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> 0 0
>   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> 0 0
>>


I get the same results in R-2.14.0 and R-3.02.  They both give the
result shown above with the structures in the output.  I used
"R version 2.14.0 (2011-10-31)".

Try starting a clean session in R 2.14.0 using:

R --vanilla

and try it again.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Multivariate time series in R 3 vs R 2

2013-10-26 Thread Андрей Парамонов
Thank you for your suggestions.
But in minimal example I provided I didn't import any package (incl. zoo).
However the behavior is different. Something in R has changed between
2.14.0 and 3.0.2.

Best wishes,
Andrey Paramonov


2013/10/25 Martyn Plummer 

> This has nothing to do with changes in base R. It is due to changes in
> the dependent packages. These changes mean that when you call lapply it
> does not dispatch the right as.list method.
>
> The method you want (as.list.ts) is provided by the zoo package. It
> splits a multivariate time series into a list of univariate time series
> in the way you are expecting.  Your package mar1s used to depend on zoo
> indirectly through the fda package. But now fda does not depend on zoo,
> it only suggests it. So now, when you load your package, zoo is not on
> the search path and you get the default as.list method, which produces
> the bad results.
>
> The solution is to add "Imports: zoo" to your DESCRIPTION file and
> "import(zoo)" to your NAMESPACE file.
>
> Martyn
>
>
> On Wed, 2013-10-23 at 22:56 +0400, Андрей Парамонов wrote:
> > Hello!
> >
> > Recently I got report that my package mar1s doesn't pass checks any more
> on
> > R 3.0.2. I started to investigate and found the following difference in
> > multivariate time series handling in R 3.0.2 compared to R 2 (I've
> checked
> > on 2.14.0).
> >
> > Suppose I wish to calculate seasonal component for time series. In case
> of
> > multivariate time series, I wish to process each column independently.
> Let
> > f be a simple (trivial) model of seasonal component:
> >
> > f <- function(x)
> >   return(ts(rep(0, length(x)), start = 0, frequency = frequency(x)))
> >
> > In previous versions of R, I used the following compact and efficient
> > expression to calculate seasonal component:
> >
> > y <- do.call(cbind, lapply(x, f))
> >
> > It worked equally good for univariate and multivariate time series:
> >
> > > R.Version()$version.string
> > [1] "R version 2.14.0 (2011-10-31)"
> > > t <- ts(1:10, start = 100, frequency = 10)
> > >
> > > x <- t
> > > y <- do.call(cbind, lapply(x, f))
> > > y
> > Time Series:
> > Start = c(0, 1)
> > End = c(0, 10)
> > Frequency = 10
> >  [1] 0 0 0 0 0 0 0 0 0 0
> > >
> > > x <- cbind(t, t)
> > > y <- do.call(cbind, lapply(x, f))
> > > y
> > Time Series:
> > Start = c(0, 1)
> > End = c(0, 10)
> > Frequency = 10
> > t t
> > 0.0 0 0
> > 0.1 0 0
> > 0.2 0 0
> > 0.3 0 0
> > 0.4 0 0
> > 0.5 0 0
> > 0.6 0 0
> > 0.7 0 0
> > 0.8 0 0
> > 0.9 0 0
> >
> > But in version 3, I get some frustrating results:
> >
> > > R.Version()$version.string
> > [1] "R version 3.0.2 (2013-09-25)"
> > > t <- ts(1:10, start = 100, frequency = 10)
> > >
> > > x <- t
> > > y <- do.call(cbind, lapply(x, f))
> > > y
> > Time Series:
> > Start = 0
> > End = 0
> > Frequency = 1
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> > >
> > > x <- cbind(t, t)
> > > y <- do.call(cbind, lapply(x, f))
> > > y
> > Time Series:
> > Start = 0
> > End = 0
> > Frequency = 1
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "ts")
> > 0 0
> >   structure(0, .Tsp = c(0, 0, 1), class = "t