<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.lang.r.general">
    <title>gmane.comp.lang.r.general</title>
    <link>http://blog.gmane.org/gmane.comp.lang.r.general</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265106"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265104"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265103"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265102"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265100"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265090"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265080"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265079"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265078"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265067"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265061"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265057"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265055"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265053"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265049"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265038"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265019"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265018"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265016"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/265015"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265106">
    <title>how to check given number seq.  is time series or not?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265106</link>
    <description>&lt;pre&gt;i have following numbers 

 0.889046409368551 
 1.22726162946495 
 1.22726162946495 
 1.35785109728356 
 1.35785109728356 
 1.10704609982913 
 1.4424189950435 
 1.2277843378837 
 1.35785109728356 
 0.970883941918588 
 0.822170913920467 
 1.35785109728356 
 0.358815782262543 
 0.774234247460432 
 0.822170913920467 
 0.822170913920467 
 0.72599976881814 
 0.671583894425946 
 0.813223271443211 
 0.774234247460432 
 1.00184802593319 
 1.4424189950435 
 1.22726162946495 
 0.970883941918588 
 0.358815782262543 
 1.31016840948316 
 0.970883941918588 
 1.4424189950435 
 0.889046409368551 
 4.91679981837699 
 1.2277843378837 
 1.21605333196293 
 0.369861996166875 
 0.774748148811057 
 0.369861996166875 
 1.4424189950435 
 1.22726162946495 
 1.4424189950435 
 1.22726162946495 
 1.16291100715022 
 2.33863311242767 
 0.774234247460432 
 4.91679981837699 
 0.9670580678417 
 0.970883941918588 
 0.9670580678417 
 1.10704609982913 
 4.91679981837699 
 1.4424189950435 
 1.05410985855726 
 1.22726162946495 
 1.21605333196293 
 1.35785109728356 
 0.822170913920467 
 1.4424189950435 
 0.970883941918588 
 0.835429195630044 
 0.774234247460432 
 1.61328986496929 
 0.970883941918588 
 1.2277843378837 
 1.22726162946495 
 0.970883941918588 
 1.10704609982913 
 1.10704609982913 
 1.10704609982913 
 1.4424189950435 
 1.22726162946495 
 1.4424189950435 
 1.35785109728356 
 0.9670580678417 
 0.9670580678417 
 0.885419165744907 
 1.16291100715022 
 0.369861996166875 
 0.9670580678417 
 0.774748148811057 
 1.22726162946495 
 1.4424189950435 
 1.22726162946495 
 1.31016840948316 
 0.813223271443211 
 1.4424189950435 
 0.822170913920467 
 1.05410985855726 
 0.853014111520372 
 1.3245534157835 
 0.774234247460432 
 0.774234247460432 
 1.22726162946495 
 0.889046409368551 
 1.4424189950435 
 0.842622628771215 
 0.889046409368551 
 0.889046409368551 
 1.31898472833595 
 1.4424189950435 
 1.35785109728356 
 0.682617341489085 
 0.965180291004232 

i don't want to check by plotting graph of above data(because i have
thousands of such data structures)
is there any function in R to check it ?
how can i check validity by programming?



--
View this message in context: http://r.789695.n4.nabble.com/how-to-check-given-number-seq-is-time-series-or-not-tp4631434.html
Sent from the R help mailing list archive at Nabble.com.

&lt;/pre&gt;</description>
    <dc:creator>sagarnikam123</dc:creator>
    <dc:date>2012-05-26T09:13:37</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265104">
    <title>Values in scatterplot??</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265104</link>
    <description>&lt;pre&gt;Hi R-listers, 

I am having trouble plotting the values for the R2 line, lowess smooth,
smothered conditional spread, outlier identification. 
I have tried the function text and legend but was unsuccessful. Please see
below.

Your help would be appreciated. Thanks in advance.

Jean



library(car)
+                        data = data.to.analyze,
+                        xlab = "Distance to high tide line (metres)",
+                        ylab = "Hatching success (%)")

+                                         
format(summary(SPHSHTL)$adj.r.squared, digits=4)))
Error in summary(SPHSHTL)$adj.r.squared : 
  $ operator is invalid for atomic vectors

Error in text.default(SPHSHTL) : zero length 'labels'

--
View this message in context: http://r.789695.n4.nabble.com/Values-in-scatterplot-tp4631431.html
Sent from the R help mailing list archive at Nabble.com.

&lt;/pre&gt;</description>
    <dc:creator>Jhope</dc:creator>
    <dc:date>2012-05-26T06:17:37</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265103">
    <title>How to transform OLS covariance matrix to White standard errors?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265103</link>
    <description>&lt;pre&gt;Hi!

I am working with a regression of a log-log model that suffers from
heteroskedasticity. I have calculated the "White standard errors". I would
like to use these "White standard errors" in a RESET test instead of the
originally OLS standard errors calculated by the regression. How can I
transform the covariance matrix of a model?


labmodel2 &amp;lt;- lm(formula = log(L) ~ log(W) + log(K) + log(Y), data=labordat)
sumlabmodel2 &amp;lt;- summary(labmodel2)
sumlabmodel2

coeftest(labmodel2,vcov=vcovHC(labmodel2,type="HC0"

That is, I want to replace vcov with vcovHC in labmodel2 to perform a RESET
test with the robust White standard errors.

Can anyone help?

Thank you!



--
View this message in context: http://r.789695.n4.nabble.com/How-to-transform-OLS-covariance-matrix-to-White-standard-errors-tp4631432.html
Sent from the R help mailing list archive at Nabble.com.

&lt;/pre&gt;</description>
    <dc:creator>Dunken</dc:creator>
    <dc:date>2012-05-26T07:09:17</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265102">
    <title>Assessing interaction effects in GLMMs</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265102</link>
    <description>&lt;pre&gt;Dear R gurus

I am running a GLMM that looks at whether chimpanzees spend time in shade
more than sun (response variable 'y': used cbind() on counts in the sun and
shade) based on the time of day (Time) and the availability of shade
(Tertile). I've included some random factors too which are the chimpanzee
in question (Individual) and where they are in a given area (Zone). There
are also two continuous predictors (Minimum daily temperature: Min; Maximum
daily temperature: Max). I have run my GLMM and I know that Time and Min
are significant predictors of the patterns of shade use while Tertile and
Max are not. In addition, a Time*Tertile interaction effect is a good
predictor as well.

I now need to assess how the specific interaction effect conditions differ
to one another. So, for example, how does shade use differ between 10h00 at
low shade and 10h00 at high shade? I tried using the package multcomp, but
that will only allow me to work out the contrasts for the first-order
effects (Time, Tertile) but won't allow me to do so for the interaction
effects. Any ideas?

My code:

Min,family=binomial,REML=F)
Analysis of Deviance Table (Type III tests)

Response: y
               Chisq Df Pr(&amp;gt;Chisq)
(Intercept)   0.9511  1     0.3294
Time         60.7807  4  1.988e-12 ***
Tertile       0.3391  1     0.5603
Max           1.3198  1     0.2506
Min          77.7736  1  &amp;lt; 2.2e-16 ***
Time:Tertile 38.9038  4  7.292e-08 ***
---
Signif. codes:  0 *** 0.001 ** 0.01 * 0.05 . 0.1   1
Generalized linear mixed model fit by the Laplace approximation
Formula: y ~ Time * Tertile + (1 | Individual) + (1 | Zone) + Max + Min
  AIC  BIC logLik deviance
 1168 1224 -569.9     1140
Random effects:
 Groups     Name        Variance Std.Dev.
 Zone       (Intercept) 0.81949  0.90526
 Individual (Intercept) 0.36417  0.60347
Number of obs: 412, groups: Zone, 8; Individual, 7

Fixed effects:
                     Estimate Std. Error z value Pr(&amp;gt;|z|)
(Intercept)           0.77498    0.79465   0.975 0.329439
Time11h00            -1.54259    0.24351  -6.335 2.38e-10 ***
Time12h00             0.01695    0.77829   0.022 0.982627
Time13h00            -4.26913    0.78217  -5.458 4.81e-08 ***
Time14h00            -1.34503    0.43831  -3.069 0.002150 **
TertileLow            0.32614    0.56003   0.582 0.560323
Max                   0.03751    0.03265   1.149 0.250630
Min                  -0.30912    0.03505  -8.819  &amp;lt; 2e-16 ***
Time11h00:TertileLow  1.03079    0.28579   3.607 0.000310 ***
Time12h00:TertileLow -2.26187    0.79930  -2.830 0.004658 **
Time13h00:TertileLow  2.38129    0.79214   3.006 0.002646 **
Time14h00:TertileLow  1.72263    0.49397   3.487 0.000488 ***
---
Signif. codes:  0 *** 0.001 ** 0.01 * 0.05 . 0.1   1

Correlation of Fixed Effects:
            (Intr) Tm1100 Tm1200 Tm1300 Tm1400 TrtlLw Max    Min    T1100:
Time11h00   -0.026
Time12h00   -0.035  0.177
Time13h00   -0.004  0.223  0.068
Time14h00   -0.073  0.259  0.081  0.103
TertileLow  -0.450  0.153  0.043  0.051  0.097
Max         -0.711 -0.169 -0.004 -0.061 -0.023  0.019
Min          0.146  0.186  0.014  0.055  0.099 -0.036 -0.455
Tm11h00:TrL  0.059 -0.851 -0.153 -0.190 -0.222 -0.198  0.096 -0.155
Tm12h00:TrL  0.095 -0.160 -0.974 -0.062 -0.081 -0.067 -0.079  0.012  0.192
Tm13h00:TrL  0.026 -0.208 -0.067 -0.983 -0.099 -0.075  0.024 -0.026  0.229
Tm14h00:TrL  0.126 -0.215 -0.069 -0.088 -0.876 -0.185 -0.047  0.006  0.254
            T1200: T1300:
Time11h00
Time12h00
Time13h00
Time14h00
TertileLow
Max
Min
Tm11h00:TrL
Tm12h00:TrL
Tm13h00:TrL  0.081
Tm14h00:TrL  0.098  0.116

Luke Duncan

*Post-doctoral** Fellow*
*School of Animal, Plant and Environmental Sciences*
*University of the Witwatersrand*
*Johannesburg, South Africa*
**
*+27 72 312 0330*
*+27 11 717 6452*

[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>Luke Duncan</dc:creator>
    <dc:date>2012-05-26T10:19:52</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265100">
    <title>How to draw y axis in horizontal bar plot?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265100</link>
    <description>&lt;pre&gt;http://r.789695.n4.nabble.com/file/n4631428/Image2.png 

How can i draw y axis in bar plot at x = 0?

After plotting axis it will look like.



--
View this message in context: http://r.789695.n4.nabble.com/How-to-draw-y-axis-in-horizontal-bar-plot-tp4631428.html
Sent from the R help mailing list archive at Nabble.com.

&lt;/pre&gt;</description>
    <dc:creator>Manish Gupta</dc:creator>
    <dc:date>2012-05-26T02:53:43</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265090">
    <title>"shift" + "arrow" in getGraphicsEvent</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265090</link>
    <description>&lt;pre&gt;Hi the list,

Do you know if getGraphicsEvent can detect the use of keys combinaison like
"shift+arrow" or "Crlt+arrow" ?

Best
Christophe

--
View this message in context: http://r.789695.n4.nabble.com/shift-arrow-in-getGraphicsEvent-tp4631419.html
Sent from the R help mailing list archive at Nabble.com.

&lt;/pre&gt;</description>
    <dc:creator>cgenolin</dc:creator>
    <dc:date>2012-05-25T22:33:40</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265080">
    <title>evaluate whether function returns error</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265080</link>
    <description>&lt;pre&gt;Hi,

The following returns an error message. How do I evaluate (TRUE or FALSE)
the function?

require(XML)
readHTMLTable("http://www.sec.gov/Archives/edgar/data/2969/000095012399010952/0000950123-99-010952.txt")

Thanks in advance!

Math

--
View this message in context: http://r.789695.n4.nabble.com/evaluate-whether-function-returns-error-tp4631406.html
Sent from the R help mailing list archive at Nabble.com.

&lt;/pre&gt;</description>
    <dc:creator>mdvaan</dc:creator>
    <dc:date>2012-05-25T20:52:35</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265079">
    <title>change colors/ symbols of lda plots</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265079</link>
    <description>&lt;pre&gt;Greetings R experts,

I am running a simple lda on some simulation data of mine to show an illustration of my multivariate response data, since it is a simulation I have a very large amount of data and the default on plot seems to plot the category names. This is very difficult to interpret even changing the abbreviations. At the expense of sounding naive, my question(s) are:

How can I color code my four categories?

and how can I change the unit display to something simple like a dot, and not the names or abbreviated names of the categories?


Cheers,
-Dan

[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>dgates&lt; at &gt;huskers.unl.edu</dc:creator>
    <dc:date>2012-05-25T19:50:11</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265078">
    <title>Selecting with mouse the lines drawn by matplot()</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265078</link>
    <description>&lt;pre&gt;Dear all,

I have a dataset of spectral measurements of sunlight. One row for each 
different observation, one column for each spectral channel.

I would like to select the spectral curves drawn with matplot() (I only 
know matplot() as a way of easily drawing them) with the help of the 
mouse and extract their row indexes  :

a=url("http://ekumen.homelinux.net/spectra.RData")
load(a)
matplot(lbd2, t(mySpectra), type="l",xlab="Wavelength [nm]",ylab="Radiance")

I was hoping that identify() would work on such a graphic but 
unfortunately it does not. I tried to the "identify" function of the 
package playwith(), but still the same problem.

I think I will have to write a function that does the job. But before 
that, I would like to have your opinions. What would be the easiest way 
of accomplishing this task?

Thank you very much
Best regards
servet

&lt;/pre&gt;</description>
    <dc:creator>servet cizmeli</dc:creator>
    <dc:date>2012-05-25T20:52:43</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265067">
    <title>knitr customization</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265067</link>
    <description>&lt;pre&gt;
I am trying to transition from Sweave to knitr, but there are a few
things about customization of the appearence of R input and output that
I did not get yet. Maybe somebody on the list can help me.

In my Sweave presentations I used a slanted font for the R input and a
normal font for the output, both in a small font. I also indented
everything by an extra 2em. All this was achieved by the following
instructions in the .Rnw file:

\DefineVerbatimEnvironment{Sinput}{Verbatim}{xleftmargin=2em, 
  fontsize=\footnotesize, fontshape=sl}
\DefineVerbatimEnvironment{Soutput}{Verbatim}{xleftmargin=2em, 
  fontsize=\footnotesize}

In order to get a similar result (with a tiny size instead of a footnote
size, but that is not the point) with knitr I included in the .Rnw file
the lines

\ifdefined\knitrout
  \renewenvironment{knitrout}{\begin{tiny}\slshape}{\end{tiny}}
\else
\fi
  
What I get is something like this: 

http://definetti.uark.edu/~gpetris/knitr-output.pdf 

The problem is that the prompt sign '&amp;gt;' did not change either size or
shape. So I am probably not using the correct approach. How should I be
doing?

Also, what do I have customize, and how, in order to get the extra left
margin?

Final question: how can I get the continuation sign '+'? (This is for an
introductory presentation in which I want to show people exactly what
they are going to see on their screen.) 

Oops, one more... How can I change the spacing between regular text and
R code (input/output)? With Sweave I would do

\fvset{listparameters={\setlength{\topsep}{0pt}}}
\renewenvironment{Schunk}{\vspace{\topsep}}{\vspace{\topsep}}


Sorry for the many questions and thank you in advance for any help and
insight you can give me.

Best,
Giovanni


&lt;/pre&gt;</description>
    <dc:creator>Giovanni Petris</dc:creator>
    <dc:date>2012-05-25T19:30:04</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265061">
    <title>question about TryCatch and lapply</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265061</link>
    <description>&lt;pre&gt;Folks:

I've replaced an outer for-loop with lapply and it works great.  But, I
can't seem to do the following type of exception handling:

tryCatch(dlmMLE(x)$value==Inf,error = function(e) NULL)

which basically says if the likelihood is Inf, throw an error.  But what I
want it to do is just go to the next index in the list.  When I was using a
for-loop I used:

if(tryCatch(dlmMLE(x)$value==Inf,error = function(e) 1)==1) {next} else
.... which worked fine.

Is there a way to do the same thing in lapply?

Thanks for your time. (I've checked Gmane for this type of problem and I
wasn't sure if this problem was answered or not...)

John

[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>John Kerpel</dc:creator>
    <dc:date>2012-05-25T18:51:23</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265057">
    <title>How to change width of bar when there are very few bars?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265057</link>
    <description>&lt;pre&gt;http://r.789695.n4.nabble.com/file/n4631371/Bar_Chart.png 


How to control width of bar chart when there are very few bars in plot? 


Regards

--
View this message in context: http://r.789695.n4.nabble.com/How-to-change-width-of-bar-when-there-are-very-few-bars-tp4631371.html
Sent from the R help mailing list archive at Nabble.com.

&lt;/pre&gt;</description>
    <dc:creator>Manish Gupta</dc:creator>
    <dc:date>2012-05-25T18:03:31</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265055">
    <title>Reading a bunch of csv files into R</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265055</link>
    <description>&lt;pre&gt;Dear R users


I am struggling from a data importing issue:

I have some hundreds of csv files needed to be read into R for futher
analysis. All those csv files are named in one of the three formats:

(1) strings: e.g. London_Oxford street
(2) Integer: e.g. 1234_5678
(3) combined: e.g. London_1234

I intend to use read.csv("xxxx_xxx.csv") but I only dealt with
sigle documents before and if there are only no more than 20 files, I do
not bother to search a more efficient way.


Is there any claver way that I do not have to type in all these hundreds
names by hand, maybe using a R package or write some code in some other
languages if it is not too difficult to learn.

Any thoughts/hints please??

Many thanks in advance!

HJ

[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>HJ YAN</dc:creator>
    <dc:date>2012-05-25T17:16:15</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265053">
    <title>difference between qnorm and qqnorm</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265053</link>
    <description>&lt;pre&gt;dear all,
it will just take you a minute to tell me the difference 
between qnorm and qqnorm. are they same or is there any 
difference between them??
regards

&lt;/pre&gt;</description>
    <dc:creator>QAMAR MUHAMMAD UZAIR</dc:creator>
    <dc:date>2012-05-25T16:41:54</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265049">
    <title>subset columns from list with variable substitution</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265049</link>
    <description>&lt;pre&gt;Hi there, I would like to use a list variable to select columns in a subset
from a parent table:

I have a data frame "table" with column headers a,b,c,d,e,x,y,z

and list variables

list1=c("a","b","c","d")
list2=c("a","b","x",y","z")
namelist=c("peter","paul","mary","jane")
group1=c("peter","paul")
group2=c("mary","jane")

I would like to subset "table" based on the list variable in a for loop:

for (i %in% namelist){
     if (i %in% group1){table2&amp;lt;-subset(table, select=list1)}
     else {{table2&amp;lt;-subset(table, select=list2)}
}

the "select=list1" syntax does not work. What would be the correct way to do
this?

Many Thanks

Jon

--
View this message in context: http://r.789695.n4.nabble.com/subset-columns-from-list-with-variable-substitution-tp4631374.html
Sent from the R help mailing list archive at Nabble.com.

&lt;/pre&gt;</description>
    <dc:creator>jween</dc:creator>
    <dc:date>2012-05-25T18:09:34</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265038">
    <title>Query about creating time sequences</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265038</link>
    <description>&lt;pre&gt;Hi All,

I have a query about time based sequences. I know such questions have been
asked a lot on forums, but I couldnt find the exact thing that I was
looking for.

I want to create a time-based sequence which will mimic the trading window
AND would span multiple days. Something like below:

"2011-01-03 09:15:00 IST"
"2011-01-03 09:15:01 IST"
....
....
....
"2011-01-03 15:29:59 IST"
"2011-01-03 15:30:00 IST"
"2011-01-04 09:15:00 IST"
"2011-01-04 09:15:01 IST"
....
....
....
"2011-01-04 15:29:59 IST"
"2011-01-04 15:30:00 IST"

Kindly notice the change of date in the sequence.

The Indian Equity markets open at 09:15:00 and close at 15:30:00. I have
equity data that spans 124 days, and I need to create a corresponding
sequence which I will later use to regularize the irregular dataset to make
a regular time-series.

I was able to accomplish this task for a single day (i.e. creating a
sequence then merging my dataset with it and use na.locf to make my dataset
regular) but am unable to create a sequence for 'n' number of days. Can
anyone help me with this?

If it is of any help, I have a file which contains all the dates for which
I need the sequence. The dput of the file is placed at the end of the
email.

One option is to create sequences for the entire days and then later remove
all these records after merging. Although I havent checked the feasibility
of this method, it would be complex and more so it will increase the data
four folds (I already have 2 million records in the dataframe which I have
to make regular).

Another approach that I could think of was to make a timebased sequence
based on the date from the file and then use a loop to append one sequence
after another. But am not having much success there either.

Any kind of help would be greatly appreciated.

Thanks and regards,
Shivam

structure(list("20110103", "20110104", "20110105", "20110106",
    "20110107", "20110110", "20110111", "20110112", "20110113",
    "20110114", "20110117", "20110118", "20110119", "20110120",
    "20110121", "20110124", "20110125", "20110127", "20110128",
    "20110131", "20110201", "20110202", "20110203", "20110204",
    "20110207", "20110208", "20110209", "20110210", "20110211",
    "20110214", "20110215", "20110216", "20110217", "20110218",
    "20110221", "20110222", "20110223", "20110224", "20110225",
    "20110228", "20110301", "20110303", "20110304", "20110307",
    "20110308", "20110309", "20110310", "20110311", "20110314",
    "20110315", "20110316", "20110317", "20110318", "20110321",
    "20110322", "20110323", "20110324", "20110325", "20110328",
    "20110329", "20110330", "20110331", "20110401", "20110404",
    "20110405", "20110406", "20110407", "20110408", "20110411",
    "20110413", "20110415", "20110418", "20110419", "20110420",
    "20110421", "20110425", "20110426", "20110427", "20110428",
    "20110429", "20110502", "20110503", "20110504", "20110505",
    "20110506", "20110509", "20110510", "20110511", "20110512",
    "20110513", "20110516", "20110517", "20110518", "20110519",
    "20110520", "20110523", "20110524", "20110525", "20110526",
    "20110527", "20110530", "20110531", "20110601", "20110602",
    "20110603", "20110606", "20110607", "20110608", "20110609",
    "20110610", "20110613", "20110614", "20110615", "20110616",
    "20110617", "20110620", "20110621", "20110622", "20110623",
    "20110624", "20110627", "20110628", "20110629", "20110630"), .Dim =
c(124L,
1L), .Dimnames = list(c("X1", "X2", "X3", "X4", "X5", "X6", "X7",
"X8", "X9", "X10", "X11", "X12", "X13", "X14", "X15", "X16",
"X17", "X18", "X19", "X20", "X21", "X22", "X23", "X24", "X25",
"X26", "X27", "X28", "X29", "X30", "X31", "X32", "X33", "X34",
"X35", "X36", "X37", "X38", "X39", "X40", "X41", "X42", "X43",
"X44", "X45", "X46", "X47", "X48", "X49", "X50", "X51", "X52",
"X53", "X54", "X55", "X56", "X57", "X58", "X59", "X60", "X61",
"X62", "X63", "X64", "X65", "X66", "X67", "X68", "X69", "X70",
"X71", "X72", "X73", "X74", "X75", "X76", "X77", "X78", "X79",
"X80", "X81", "X82", "X83", "X84", "X85", "X86", "X87", "X88",
"X89", "X90", "X91", "X92", "X93", "X94", "X95", "X96", "X97",
"X98", "X99", "X100", "X101", "X102", "X103", "X104", "X105",
"X106", "X107", "X108", "X109", "X110", "X111", "X112", "X113",
"X114", "X115", "X116", "X117", "X118", "X119", "X120", "X121",
"X122", "X123", "X124"), NULL))

[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>Shivam</dc:creator>
    <dc:date>2012-05-25T17:14:02</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265019">
    <title>Breaking up a vector</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265019</link>
    <description>&lt;pre&gt;Hi all,

My problem is as follows: 

I want to run a loop which calculates two values and stores them in vectors
r and rv, respectively.
They're calculated from some vector x with length a multiple of 7.

x &amp;lt;- c(1:2058)

I need to difference the values but it would be incorrect to difference it
all in x, it has to be broken up first. I've tried the following:

r &amp;lt;- c(1:294)*0
rv &amp;lt;- c(1:294)*0

#RUN A LOOP WHERE YOU INPUT THE lx[(i-1)*7:i*7] INTO Z
for (i in 1:294){
#CREATE A NEW VECTOR OF LENGTH 7
z &amp;lt;- NULL
length(z)=7
dz &amp;lt;- NULL
dz2 &amp;lt;- NULL

#STORE THE VALUES IN z
z &amp;lt;- lx[1+(i-1)*7:(i)*7]

#THEN DIFFERENCE THOSE
#THIS IS r_t,i,m
dz=diff(z)

#SUM THIS UP AND STORE IT IN r, THIS IS r_t
r[i] &amp;lt;- sum(dz)

#SUM UP THE SQUARES AND STORE IT IN rv, THIS IS RV_t
dz2 &amp;lt;- dz^2
rv[i] &amp;lt;- sum(dz2)
#END THE LOOP
}


However, the window seems to expand for some reason, so z ends up being a
much longer vector than it should be and full of NAs.


Any help or advice is much appreciated.

Aodhán


--
View this message in context: http://r.789695.n4.nabble.com/Breaking-up-a-vector-tp4631329.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help&amp;lt; at &amp;gt;r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
&lt;/pre&gt;</description>
    <dc:creator>AOLeary</dc:creator>
    <dc:date>2012-05-25T15:29:27</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265018">
    <title>Problem with Autocorrelation and GLS Regression</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265018</link>
    <description>&lt;pre&gt;Hi,

I have a problem with a regression I try to run. I did an estimation of the
market model with daily data. You can see to output below:

/&amp;gt; summary(regression_resn)
Time series regression with "ts" data:
Start = -150, End = -26
Call:
dynlm(formula = ror_resn ~ ror_spi_resn)

Residuals:
       Min         1Q     Median         3Q        Max 
-0.0255690 -0.0030378  0.0002787  0.0039887  0.0257857 

Coefficients:
               Estimate Std. Error t value Pr(&amp;gt;|t|)
(Intercept)  -0.0003084  0.0007220  -0.427    0.670
ror_spi_resn  0.0363940  0.0706150   0.515    0.607

Residual standard error: 0.008016 on 123 degrees of freedom
Multiple R-squared: 0.002155,Adjusted R-squared: -0.005958 
F-statistic: 0.2656 on 1 and 123 DF,  p-value: 0.6072 /

I did several tests for assessing the quality of the estimation (like
breusch-pagan, breusch-godfrey, chow-breakpoint, arch lm tests).  The model
has now clearly a problem with autocorrelation as you can see in de images
below:
http://r.789695.n4.nabble.com/file/n4631336/resid_resn.png 
http://r.789695.n4.nabble.com/file/n4631336/pacf_resid_resn.png 
To take into account the problem of autocorrelation, I did a gls estimation
with an AR(1) process and get the following output: 

/&amp;gt; summary(gls(ror_resn~ror_spi_resn, correlation=corARMA(p=1),
method="ML"))
Generalized least squares fit by maximum likelihood
  Model: ror_resn ~ ror_spi_resn 
  Data: NULL 
        AIC       BIC   logLik
  -859.0308 -847.7176 433.5154

Correlation Structure: AR(1)
 Formula: ~1 
 Parameter estimate(s):
       Phi 
-0.3182399 

Coefficients:
                   Value  Std.Error    t-value p-value
(Intercept)  -0.00034277 0.00052344 -0.6548430  0.5138
ror_spi_resn  0.04337265 0.06741179  0.6433986  0.5212

 Correlation: 
             (Intr)
ror_spi_resn -0.159

Standardized residuals:
        Min          Q1         Med          Q3         Max 
-3.21202187 -0.38283220  0.03863226  0.50313857  3.24224614 

Residual standard error: 0.007953852 
Degrees of freedom: 125 total; 123 residual/

I plot acf and pacf again to assess the changes in autocorrelation. But
interestingly, there is no change in the plots, they are equal to the images
above...

Can anyone give advice on how to handle this problem?  There is the
possibility that I am clearly on the wrong path. I am still a beginner in
using R. Furthermore, I did the same procedure with EVIEWS (also
implementing AR(1) process) and the model gives different results for the
coefficients and error terms. 

Regards
Andi

/Output EVIEWS:

Dependent Variable: ROR_RESN
Method: Least Squares
Date: 05/25/12   Time: 17:17
Sample (adjusted): 2 125
Included observations: 124 after adjustments
Convergence achieved after 7 iterations

VariableCoefficientStd. Errort-StatisticProb.  

C-0.0004090.000525-0.7790740.4375
ROR_SPI_RESN0.0529960.0677940.7817160.4359
AR(1)-0.3142600.085592-3.6715860.0004

R-squared0.104144    Mean dependent var-0.000365
Adjusted R-squared0.089337    S.D. dependent var0.007945
S.E. of regression0.007581    Akaike info criterion-6.902354
Sum squared resid0.006955    Schwarz criterion-6.834122
Log likelihood430.9460    Hannan-Quinn criter.-6.874637
F-statistic7.033211    Durbin-Watson stat2.070520
Prob(F-statistic)0.001289

Inverted AR Roots     -.31
/

--
View this message in context: http://r.789695.n4.nabble.com/Problem-with-Autocorrelation-and-GLS-Regression-tp4631336.html
Sent from the R help mailing list archive at Nabble.com.

&lt;/pre&gt;</description>
    <dc:creator>and_mue</dc:creator>
    <dc:date>2012-05-25T15:42:27</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265016">
    <title>count number of groups</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265016</link>
    <description>&lt;pre&gt;Hello,

Simple question that I am stuck on and can't seem to find an answer in the
help files currently.  I have a list which contains repeated ID's.  I would
like to have R count the number of ID's.  For example:

ID=c(1,1,1,1,2,2,2,2,3,3,3,3)
as.data.frame(ID)

Clearly, there are 3 groups.  How would I have R give me the summary:

ID
3

Many thanks,
Charles

[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>Charles Determan Jr</dc:creator>
    <dc:date>2012-05-25T15:38:07</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265015">
    <title>Rolling Sample VAR</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265015</link>
    <description>&lt;pre&gt;hi guys,

I am using trivariate VAR model to get 10 step ahead orthogonalized impulse
response functions. I want to use rolling sample analysis on the
coefficients of the irf  but I have no idea how to do that. I looked through
the forums but I can't seem to find any solutions.

Any suggestions would be helpful.

B 

--
View this message in context: http://r.789695.n4.nabble.com/Rolling-Sample-VAR-tp4631328.html
Sent from the R help mailing list archive at Nabble.com.

&lt;/pre&gt;</description>
    <dc:creator>bantex</dc:creator>
    <dc:date>2012-05-25T15:22:59</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/265010">
    <title>Problem sourcing file</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/265010</link>
    <description>&lt;pre&gt;Hi all,

 

I created a file to define some functions. When I try to source this file,
sometimes it works but sometimes I get the following error:

 


 

Error in srcfilecopy(filename, lines, file.info(filename)[1, "mtime"]) : 

  unused argument(s) (file.info(filename)[1, "mtime"])

 

It works when I just started the R session, but after using some libraries
when I do the source of the file again, I get this error. I can not really
follow what steps aret he ones that bring me to the error, I only know that
sometimes it appears. Does someone know the possible cause?

 

Thanks!

Marta


[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>Marta Tolós</dc:creator>
    <dc:date>2012-05-25T14:08:55</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.lang.r.general">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.lang.r.general</link>
  </textinput>
</rdf:RDF>

