Paul | 21 Apr 01:04 2015

How numerical data is stored inside ts time series objects

I'm getting familiar with the stl function in the stats packcage by
trying it on an example from Brockwell & Davis's 2002 "Introduction to
Times Series and Forcasting".  Specifically, I'm using a subset of his
red wine sales data.  It's a detour from the stl material at (at some point, I
have to stop simply following and try to make it work with new data).

I need a minimum of 36 wine sales data points in the series, since stl
otherwise complains about the data being less than 2 cycles.  The data
is in ~/tmp/wine.txt:

(Continue reading)

Carlijn Wibbelink | 20 Apr 22:05 2015

Metafor - function - variance components

Hi all,

I have a question about metafor and the function. I have fitted a multivariate model (effect sizes
are nested within studies) and I've found two variances: 

Variance Components: 
                      estim    sqrt     nlvls  fixed  factor
sigma^2.1  0.0257  0.1602     72     no       y
sigma^2.2  0.0694  0.2635     10     no      ID 

I want to test whether there is significant variantion between the effect sizes within studies
(sigma^2.1: 0.0257) and/or between studies (sigma^2.2: 0.0694). In metaSEM you can fix for example the
variance within studies (sigma^2.1) to zero to test whether there is a significant difference in fit
between the models (and if so, then there is significant heterogeneity between the effect sizes within
studies). I was wondering if this is also possible in metafor. If I fix sigma2 to zero, then both variances
are fixed to zero. However, I want to fix only one variance to zero. 
I hope that someone can help me. Thank you in advance!
	[[alternative HTML version deleted]]

ismail hakkı sonalcan | 20 Apr 19:19 2015

feature selection


I want to make feature selection.
Could you help me.

John Kane | 20 Apr 19:38 2015

Re: Problem with col

> -----Original Message-----
> From: soniaamin5 <at>
> Sent: Mon, 20 Apr 2015 18:56:19 +0200
> To: sarah.goslee <at>
> Subject: Re: [R] Problem with col

 --- clip--
> When I type data , I obtain all the numeric values and the headears  I
> added (Consommation,Cylindre,Puissance,Poids)

No you probably do not, as Sarah explained.

As a quick example of the issue look at the two data sets below. Just copy and paste into your R editor.  Both
data sets are in dput() format which is how you should supply sample data to R-help.

ddat1  <-   structure(list(aa = structure(1:4, .Label = c("a", "b", "c",
"d"), class = "factor"), bb = 1:4), .Names = c("aa", "bb"), row.names = c(NA,
-4L), class = "data.frame")

ddat2 <- structure(list(aa = c("a", "b", "c", "d"), bb = c("1", "2", "3", "4")), .Names = c("aa", "bb"),
row.names = c(NA, -4L), class = "data.frame")

If yo do
they look the same on the screen but if you do str()  they are not the same.
(Continue reading)

Sarah Goslee | 20 Apr 19:05 2015

Re: Problem with col

On Mon, Apr 20, 2015 at 12:56 PM, Sonia Amin <soniaamin5 <at>> wrote:
> Sorry Sarah  for my basic question: what does "a column was read as factor"
> mean?

A factor is one of the basic types of data in R, and in statistics
generally, eg M/F or red/white/blue - a predetermined set of
categories that may or may not have an order.

More relevantly, if there's something wrong in your data, a stray
letter or quote mark for instance, that column is no longer numeric,
and R will read it as a factor by default, otherwise as character.


which is NOT the same as just typing data, will show you the classes
of your columns, among other things.

> When I type data , I obtain all the numeric values and the headears  I added
> (Consommation,Cylindre,Puissance,Poids)

If you just look at data directly, you'll see what look like numbers,
perhaps, but according to R one or more columns are not actually
numbers. That's why you need str(data).

Your problem looks like a lack of basic understanding of how R works.
Here are a couple of sources that might help you get started:

For more help, you should provide at least the output of str(data) to
(Continue reading)

Sonia Amin | 20 Apr 18:33 2015

Problem with col

Dear All,

I have written the following lines:

= FALSE, sep = "")
 result.model1<-lm(Consommation~Cylindre+Puissance+Poids, data=data)

I obtained the following message:

lm(formula = Consommation ~ Cylindre + Puissance + Poids, data = data)

Error in quantile.default(resid) : factors are not allowed
In addition: warning message:
In Ops.factor(r, 2) :
  ‘^’ This is not relevant for factors

Where is the problem?
Thank you in advance

	[[alternative HTML version deleted]]

R-help <at> mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide
(Continue reading)

CHIRIBOGA Xavier | 20 Apr 17:50 2015

groupedData HELP!

Dear members,

what to do when this appears ?

Error: could not find function "groupedData"

Thanks a lot,


j. van den hoff | 20 Apr 17:01 2015

color handling in `barplot' inconsistent betwen `beside=FALSE' and `beside=TRUE'


consider the following example:

x <- matrix(1:6, 3, 2)
barplot(x, beside = TRUE, col = 1:6)
barplot(x, beside = FALSE, col = 1:6)

it seems, it is not possible to make `beside=FAlSE' plots behave the same  
as `beside=TRUE' plots (i.e. use unique colors for all bars or bar  
components), or is it? if I do not miss something, I would say the present  
behaviour (as of 3.1.3) is not (or not always, anyway) desirable. rather,  
`beside=FALSE' should use the same color for all bars or bar components as  

any opionions on that?

in case someone needs this, the following patch achieves what I would  
expect from `barplot(beside=FALSE, ...)' -- at least w.r.t. colors, if not  
shading ... -- in the first place:

 <at>  <at>  -96,12 +96,12  <at>  <at> 
      if (beside)
          w.m <- matrix(w.m, ncol = NC)
      if (plot) {
-        dev.hold()
(Continue reading)

Dimitri Liakhovitski | 20 Apr 15:59 2015

regexpr - ignore all special characters and punctuation in a string


Please point me in the right direction.
I need to match 2 strings, but focusing ONLY on characters, ignoring
all special characters and punctuation signs, including (), "", etc..

For example:
I want the following to return: TRUE

"What a nice day today! - Story of happiness: Part 2." ==
   "What a nice day today: Story of happiness (Part 2)"


Thank you!
Dimitri Liakhovitski

Ivan Calandra | 20 Apr 15:32 2015

list server problem?

Dear all,

I use Thunderbird 31.6.0 on Mac OS 10.6.8 to download my e-mails.
Since this morning, Thunderbird downloads several times the same e-mails 
from the list, some even being from yesterday. It occurs only with 
e-mails from the R-help and not with my other professional and private 

I also checked that it was not a problem with the server on which I get 
e-mails from the R-help: the problematic e-mails are erased every time 
from the server but are received several times. So I would say that the 
R-help server has sent these e-mails several times.

I am wondering if there is currently an issue with the R-help server. Is 
someone else having the same problem?



Ivan Calandra, ATER
University of Reims Champagne-Ardenne
CREA - 2 esplanade Roland Garros
51100 Reims, France
+33(0)3 26 77 36 89
ivan.calandra <at>

(Continue reading)

PO SU | 19 Apr 21:42 2015

Two stage cluster in R(two step in spss), which package implement it ?

Dear, expeRts,
  I am confused in finding an implementation of two stage cluster in R(which is two step cluster in spss), i
do some searching, but still can not find it. Has someone happen to know it ?


mail: desolator88 <at> 
Majored in Statistics from SJTU
R-help <at> mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.