<?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/293495"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293494"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293492"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293490"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293487"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293481"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293474"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293468"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293467"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293463"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293459"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293457"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293443"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293438"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293431"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293425"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293420"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293419"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293418"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.lang.r.general/293413"/>
      </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/293495">
    <title>When the interaction term should be interpreted in AIC table?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293495</link>
    <description>&lt;pre&gt;Hi,
I would be very graitful if someone could help me to figure out my problem.

 I used mixed-effects models to analyse my data and AIC approach for model  selection. I am studying an effect on Labrador tea on basal diameter of spruce in 2 different habitats (wet and dry zones) during 3 years.
This is one of example of my AIC table:

 
  
   
   Candidate
   models
   
   
   K
   
   
   AICc
   
   
   $B&amp;amp;$(B AICc
   
   
   AICc Wt
   
  
 
 
  
  Zone + Labrador tea + Year
  
  
  9
  
  
  -17.75
  
  
  0.00
  
  
  0.80
  
 
 
  
  Zone + Labrador tea + Year + Zone $B!_(B Labrador tea
  
  
  10
  
  
  -14.69
  
  
  3.06
  
  
  0.17
  
 
 
  
  Zone + Labrador tea + Year + Year $B!_(B Labrador tea
  
  
  12
  
  
  -11.21
  
  
  6.53
  
  
  0.03
  
 
 
  
  Zone + Labrador tea
  
  
  6
  
  
  71.14
  
  
  88.88
  
  
  0.00
  
 
 
  
  Zone + Labrador tea + Zone $B!_(B Labrador tea
  
  
  7
  
  
  73.85
  
  
  91.59
  
  
  0.00
  
 

I interpreted the main effect of zone, Labrador tea and Year. My question is should I interpret the interaction term  Zone $B!_(B Labrador tea  also? Normally I interpreted the effect of variables that have been in the models with $B&amp;amp;$(B AICc &amp;lt; 4. 
One professor said I should not interpred interaction term if the main effect is stronger. But at the same time I saw articles where author interpreted the interaction term where Akaike weight was still high.

Thank you in advance.
Galina       
[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>Galina Kamorina</dc:creator>
    <dc:date>2013-05-23T22:21:46</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293494">
    <title>subsetting and Dates</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293494</link>
    <description>&lt;pre&gt;Hi,

I am trying to understand why creating Date variables does not work if I subset to avoid NAs. 

I had problems creating these Date variables in my code and I thought that the presence of NAs was the cause. So I used a condition to avoid NAs.

It turns out that NAs are not a problem and I do not need to subset, but I'd like to understand why subsetting causes the problem.
The strange numbers I start with are what I get when I read an Excel sheet with the function read.xls() from package gdata.  

dat1 = c(41327, 41334, 41341, 41348, 41355, 41362, 41369, 41376, 41383, 41390, 41397)
dat2 = dat1
dat2[c(5,9)]=NA
Data = data.frame(dat1,dat2)

keep1 = !is.na(Data$dat1)
keep2 = !is.na(Data$dat2)


Data$Dat1a = as.Date(Data[,"dat1"], origin="1899-12-30") 
Data$Dat1b[keep1] = as.Date(Data[keep1,"dat1"], origin="1899-12-30") 
Data$Dat2a = as.Date(Data[,"dat2"], origin="1899-12-30") 
Data$Dat2b[keep2] = as.Date(Data[keep2,"dat2"], origin="1899-12-30") 

Data
    dat1  dat2      Dat1a Dat1b      Dat2a Dat2b
1  41327 41327 2013-02-22 15758 2013-02-22 15758
2  41334 41334 2013-03-01 15765 2013-03-01 15765
3  41341 41341 2013-03-08 15772 2013-03-08 15772
4  41348 41348 2013-03-15 15779 2013-03-15 15779
5  41355    NA 2013-03-22 15786       &amp;lt;NA&amp;gt;    NA
6  41362 41362 2013-03-29 15793 2013-03-29 15793
7  41369 41369 2013-04-05 15800 2013-04-05 15800
8  41376 41376 2013-04-12 15807 2013-04-12 15807
9  41383    NA 2013-04-19 15814       &amp;lt;NA&amp;gt;    NA
10 41390 41390 2013-04-26 15821 2013-04-26 15821
11 41397 41397 2013-05-03 15828 2013-05-03 15828

So variables Dat1b and Dat2b are not converted to Date class.


sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] fr_CA.UTF-8/fr_CA.UTF-8/fr_CA.UTF-8/C/fr_CA.UTF-8/fr_CA.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] gdata_2.12.0

loaded via a namespace (and not attached):
[1] gtools_2.7.0

Thanks in advance,

Denis
&lt;/pre&gt;</description>
    <dc:creator>Denis Chabot</dc:creator>
    <dc:date>2013-05-23T21:35:49</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293492">
    <title>order panels in xyplot by increasing slope</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293492</link>
    <description>&lt;pre&gt;I am creating a few dozen multi-panel time series plots using lattice graphics in the lme4 package. Each panel in a given plot represents a tree. each multipanel plot is a particular treatment. Here's my issue: when you use xyplot() to plot this data it orders the panels alphabetically. I would prefer to have them in order of increasing slope of the regression line plotted in each panel. I've read everything I can find regarding the index.cond argument, and the best I can come up with is to manually order them to have the correct increasing slope order, i.e. index.cond=c(7,6,23,4,15,8,...). This would take inordinate amounts of time and I'm sure there is a better, more eloquent solution. Please help!

Sorry for the long dataset below, I'm unsure of how to create a reproducible example otherwise.

example.plot = xyplot(ht ~ time|tree, data=data,
                type = c("r", "g", "p"),
                par.settings=simpleTheme(col="blue"),
             main="abc",
             )
example.plot
data=
   tree treat site plot rx mr rxl t w     l spp time  dia    ht
1       1     1  C-H 2002  1  1  Mn N N 14.55  ac    1  9.6  74.5
2       2     1  C-H 2002  1  1  Mn N N 14.55  ac    1  7.4  69.5
3       3     1  C-H 2003  1  1  Mn N N 13.34  ac    1  6.0  66.7
4       4     1  C-H 2003  1  1  Mn N N 13.34  ac    1  7.1  75.4
5       5     1  C-H 2003  1  1  Mn N N 13.34  ac    1  7.5  57.5
6       6     1  C-H 2008  2  1  Mc N N 11.63  ac    1  5.7  71.5
7       7     1  C-H 2008  2  1  Mc N N 11.63  ac    1  5.2  50.0
8       8     1  C-H 2011  2  1  Mc N N 13.04  ac    1  6.3  62.0
9       9     1  C-H 2011  2  1  Mc N N 13.04  ac    1  6.7  60.5
10     10     1  C-H 2017  3  1   H N N 11.38  ac    1 10.7  82.0
11     11     1  C-H 2017  3  1   H N N 11.38  ac    1  4.4  27.0
12     12     1  C-H 2018  3  1   H N N 11.08  ac    1  5.8  49.0
13     13     1  C-H 2018  3  1   H N N 11.08  ac    1  4.3  64.2
14     14     1  C-H 2013  4  1 McH N N 15.09  ac    1 11.4  86.0
15     15     1  C-H 2013  4  1 McH N N 15.09  ac    1  7.6  87.5
16     16     1  C-H 2014  4  1 McH N N 14.17  ac    1  5.8  60.1
17     17     1  C-H 2014  4  1 McH N N 14.17  ac    1 11.5 100.5
18     18     1  C-H 2014  4  1 McH N N 14.17  ac    1  4.7  53.2
19     19     1  C-H 2019  5  1 MnH N N 11.72  ac    1  8.1  56.0
20     20     1  C-H 2019  5  1 MnH N N 11.72  ac    1  7.1  56.0
21     21     1  C-H 2019  5  1 MnH N N 11.72  ac    1  7.1  56.0
22     22     1  C-H 2020  5  1 MnH N N 14.71  ac    1  7.0  78.2
23     23     1  C-H 2020  5  1 MnH N N 14.71  ac    1  5.2  47.2
24     24     1  C-H 2020  5  1 MnH N N 14.71  ac    1  7.0  83.5
595     1     1  C-H 2002  1  1  Mn N N 14.55  ac    2  9.6  96.0
596     2     1  C-H 2002  1  1  Mn N N 14.55  ac    2  6.0  72.0
597     3     1  C-H 2003  1  1  Mn N N 13.34  ac    2  5.7  75.0
598     4     1  C-H 2003  1  1  Mn N N 13.34  ac    2  7.5 101.0
599     5     1  C-H 2003  1  1  Mn N N 13.34  ac    2  6.9  58.0
600     6     1  C-H 2008  2  1  Mc N N 11.63  ac    2  6.0  84.0
601     7     1  C-H 2008  2  1  Mc N N 11.63  ac    2  6.3  72.0
602     8     1  C-H 2011  2  1  Mc N N 13.04  ac    2  7.4 101.0
603     9     1  C-H 2011  2  1  Mc N N 13.04  ac    2  5.6  62.0
604    10     1  C-H 2017  3  1   H N N 11.38  ac    2 10.7 110.0
605    11     1  C-H 2017  3  1   H N N 11.38  ac    2  4.7  60.0
606    12     1  C-H 2018  3  1   H N N 11.08  ac    2  6.4  48.0
607    13     1  C-H 2018  3  1   H N N 11.08  ac    2  5.6  70.0
608    14     1  C-H 2013  4  1 McH N N 15.09  ac    2 11.0 116.0
609    15     1  C-H 2013  4  1 McH N N 15.09  ac    2  7.5 104.0
610    16     1  C-H 2014  4  1 McH N N 14.17  ac    2  6.5  61.0
611    17     1  C-H 2014  4  1 McH N N 14.17  ac    2 10.9 110.0
612    18     1  C-H 2014  4  1 McH N N 14.17  ac    2  5.9  50.0
613    19     1  C-H 2019  5  1 MnH N N 11.72  ac    2  8.1  76.0
614    20     1  C-H 2019  5  1 MnH N N 11.72  ac    2  7.1  82.0
615    21     1  C-H 2019  5  1 MnH N N 11.72  ac    2  7.1  82.0
616    22     1  C-H 2020  5  1 MnH N N 14.71  ac    2  7.6  98.0
617    23     1  C-H 2020  5  1 MnH N N 14.71  ac    2  6.1  70.0
618    24     1  C-H 2020  5  1 MnH N N 14.71  ac    2  8.4  95.0
1189    1     1  C-H 2002  1  1  Mn N N 14.55  ac    3 13.0 109.0
1190    2     1  C-H 2002  1  1  Mn N N 14.55  ac    3  9.8  77.0
1191    3     1  C-H 2003  1  1  Mn N N 13.34  ac    3  8.0  80.0
1192    4     1  C-H 2003  1  1  Mn N N 13.34  ac    3 13.0 113.0
1193    5     1  C-H 2003  1  1  Mn N N 13.34  ac    3   NA    NA
1194    6     1  C-H 2008  2  1  Mc N N 11.63  ac    3  7.7  89.0
1195    7     1  C-H 2008  2  1  Mc N N 11.63  ac    3  9.5  84.0
1196    8     1  C-H 2011  2  1  Mc N N 13.04  ac    3  6.2 122.0
1197    9     1  C-H 2011  2  1  Mc N N 13.04  ac    3   NA    NA
1198   10     1  C-H 2017  3  1   H N N 11.38  ac    3 11.5 104.0
1199   11     1  C-H 2017  3  1   H N N 11.38  ac    3  6.1  62.0
1200   12     1  C-H 2018  3  1   H N N 11.08  ac    3   NA    NA
1201   13     1  C-H 2018  3  1   H N N 11.08  ac    3   NA    NA
1202   14     1  C-H 2013  4  1 McH N N 15.09  ac    3 15.4 100.0
1203   15     1  C-H 2013  4  1 McH N N 15.09  ac    3  4.8 113.0
1204   16     1  C-H 2014  4  1 McH N N 14.17  ac    3   NA    NA
1205   17     1  C-H 2014  4  1 McH N N 14.17  ac    3   NA    NA
1206   18     1  C-H 2014  4  1 McH N N 14.17  ac    3   NA    NA
1207   19     1  C-H 2019  5  1 MnH N N 11.72  ac    3 12.4  92.0
1208   20     1  C-H 2019  5  1 MnH N N 11.72  ac    3  9.6  88.0
1209   21     1  C-H 2019  5  1 MnH N N 11.72  ac    3  9.6  88.0
1210   22     1  C-H 2020  5  1 MnH N N 14.71  ac    3 11.0  94.0
1211   23     1  C-H 2020  5  1 MnH N N 14.71  ac    3  9.0  75.0
1212   24     1  C-H 2020  5  1 MnH N N 14.71  ac    3 10.5 100.0
1783    1     1  C-H 2002  1  1  Mn N N 14.55  ac    4 13.5 102.0
1784    2     1  C-H 2002  1  1  Mn N N 14.55  ac    4   NA  76.0
1785    3     1  C-H 2003  1  1  Mn N N 13.34  ac    4 11.0  79.0
1786    4     1  C-H 2003  1  1  Mn N N 13.34  ac    4 11.8 115.0
1787    5     1  C-H 2003  1  1  Mn N N 13.34  ac    4   NA    NA
1788    6     1  C-H 2008  2  1  Mc N N 11.63  ac    4   NA  84.0
1789    7     1  C-H 2008  2  1  Mc N N 11.63  ac    4 10.5  84.0
1790    8     1  C-H 2011  2  1  Mc N N 13.04  ac    4 10.4 125.0
1791    9     1  C-H 2011  2  1  Mc N N 13.04  ac    4   NA    NA
1792   10     1  C-H 2017  3  1   H N N 11.38  ac    4 10.2 108.0
1793   11     1  C-H 2017  3  1   H N N 11.38  ac    4  7.2  66.0
1794   12     1  C-H 2018  3  1   H N N 11.08  ac    4   NA    NA
1795   13     1  C-H 2018  3  1   H N N 11.08  ac    4   NA    NA
1796   14     1  C-H 2013  4  1 McH N N 15.09  ac    4 18.5 121.0
1797   15     1  C-H 2013  4  1 McH N N 15.09  ac    4 15.0 106.0
1798   16     1  C-H 2014  4  1 McH N N 14.17  ac    4   NA    NA
1799   17     1  C-H 2014  4  1 McH N N 14.17  ac    4   NA    NA
1800   18     1  C-H 2014  4  1 McH N N 14.17  ac    4   NA    NA
1801   19     1  C-H 2019  5  1 MnH N N 11.72  ac    4 11.4 114.0
1802   20     1  C-H 2019  5  1 MnH N N 11.72  ac    4 10.6  83.0
1803   21     1  C-H 2019  5  1 MnH N N 11.72  ac    4 10.6  83.0
1804   22     1  C-H 2020  5  1 MnH N N 14.71  ac    4  8.2  94.0
1805   23     1  C-H 2020  5  1 MnH N N 14.71  ac    4  9.1  30.0
1806   24     1  C-H 2020  5  1 MnH N N 14.71  ac    4 11.0 111.0
2377    1     1  C-H 2002  1  1  Mn N N 14.55  ac    5 14.2 110.0
2378    2     1  C-H 2002  1  1  Mn N N 14.55  ac    5 10.7  92.0
2379    3     1  C-H 2003  1  1  Mn N N 13.34  ac    5 10.1  91.0
2380    4     1  C-H 2003  1  1  Mn N N 13.34  ac    5 12.3 128.0
2381    5     1  C-H 2003  1  1  Mn N N 13.34  ac    5   NA    NA
2382    6     1  C-H 2008  2  1  Mc N N 11.63  ac    5  8.5  86.0
2383    7     1  C-H 2008  2  1  Mc N N 11.63  ac    5  9.6  89.0
2384    8     1  C-H 2011  2  1  Mc N N 13.04  ac    5 11.3 130.0
2385    9     1  C-H 2011  2  1  Mc N N 13.04  ac    5   NA    NA
2386   10     1  C-H 2017  3  1   H N N 11.38  ac    5 11.2 110.0
2387   11     1  C-H 2017  3  1   H N N 11.38  ac    5  8.5  83.0
2388   12     1  C-H 2018  3  1   H N N 11.08  ac    5   NA    NA
2389   13     1  C-H 2018  3  1   H N N 11.08  ac    5   NA    NA
2390   14     1  C-H 2013  4  1 McH N N 15.09  ac    5 21.1 156.0
2391   15     1  C-H 2013  4  1 McH N N 15.09  ac    5 17.5 132.0
2392   16     1  C-H 2014  4  1 McH N N 14.17  ac    5   NA    NA
2393   17     1  C-H 2014  4  1 McH N N 14.17  ac    5   NA    NA
2394   18     1  C-H 2014  4  1 McH N N 14.17  ac    5   NA    NA
2395   19     1  C-H 2019  5  1 MnH N N 11.72  ac    5 15.1 132.0
2396   20     1  C-H 2019  5  1 MnH N N 11.72  ac    5  9.0 105.0
2397   21     1  C-H 2019  5  1 MnH N N 11.72  ac    5  9.9  90.0
2398   22     1  C-H 2020  5  1 MnH N N 14.71  ac    5 13.0 122.0
2399   23     1  C-H 2020  5  1 MnH N N 14.71  ac    5 12.3  91.0
2400   24     1  C-H 2020  5  1 MnH N N 14.71  ac    5 14.5 145.0

[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>Belair, Ethan D</dc:creator>
    <dc:date>2013-05-23T20:21:03</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293490">
    <title>Distance calculation</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293490</link>
    <description>&lt;pre&gt;Dear useRs,
i have the following data arranged in three columns

structure(c(0.492096635764151, 0.433332688044914, 0.521585941816778, 1.66472272302545, 2.61878329527404, 2.19154489521664, 0.493876245329722, 0.4915787202584, 0.889477365620806, 0.609135860199222, 0.739201878930367, 0.854663750519518, 2.06195904001605, 1.41493262330451, 1.35748791897328, 1.19490680241894, 0.702488756183322, 0.338258418490199, 0.123398398622741, 0.138548982660226, 0.16170889185798, 0.414543218677095, 1.84629295875002, 2.24547399004563), .Dim = c(12L, 2L))

The distance is to be calculated by subtracting each value of each column from the corresponding column value in the following way
=&amp;gt;The column values are cyclic. For example, after row 12 there is once again row 1. So, in a way, row 3 is more closer to row 12 than to row 8. 
=&amp;gt; The peak value is the maximum value for any column. the values falling in the range of 80% of the maximum values can also be considered as maximum value provided they are not falling immediatly next to eachother. 
=&amp;gt; If we plot column 1 and column 2 the peak value of column 1 is at 5th grade of x-axis and for column 2 its in 12th. For column 2 at x=1 the value is very close to that of the value at x=12 (in 80% range of it), but still it can considered as peak value as it is immediatly falling next to the maximum value. Now The peaks are moved towards eachother in a shortest possible way unless maximum values are under eachother
more precisely,
column 1 
1 2 3 4 5(max) 6 7 8 9 10 11 12        column 2 
1 2 3 4 5 6 7 8 9 10 11 12(max)
Now distance is measured in the following way
column 1 
1 2 3 4 5(max) 6 7 8 9 10 11 12        column 2 
12(max) 1 2 3 4 5 6 7 8 9 10 11 
a&amp;gt;sum(abs(col1-col2))
==column 1 
1 2 3 4 5(max) 6 7 8 9 10 11 12        column 2 
11 12(max) 1 2 3 4 5 6 7 8 9 10  
b&amp;gt;sum(abs(col1-col2))==column 1 
1 2 3 4 5(max) 6 7 8 9 10 11 12        column 2 
10 11 12(max) 1 2 3 4 5 6 7 8 9 
c&amp;gt;sum(abs(col1-col2))==column 1 
1 2 3 4 5(max) 6 7 8 9 10 11 12        column 2 
9 10 11 12(max) 1 2 3 4 5 6 7 8 
d&amp;gt;sum(abs(col1-col2))==column 1 
1 2 3 4 5(max) 6 7 8 9 10 11 12        column 2 
8 9 10 11 12(max) 1 2 3 4 5 6 7 
e&amp;gt;sum(abs(col1-col2))

total distance= a+b+c+d+e
For the following two column it should work the following way

structure(c(0.948228727226247, 1.38569091844218, 0.910510759802679, 1.25991218521949, 0.993123416952421, 0.553640392997634, 0.357487763503204, 0.368328033777003, 0.344255688489322, 0.423679560916755, 1.32093576037521, 3.13420679229785, 0.766278117577654, 0.751997501086888, 0.836280758630117, 1.188156460303, 1.56771616670373, 1.15928168139479, 0.522523036011874, 0.561678840701488, 1.11155735914479, 1.26467106348848, 1.09378883406298, 1.17607018089421), .Dim = c(12L, 2L))
column 1 
1 2 3 4 5 6 7 8 9 10 11 12(max)        column 2 
1 2 3 4 5(max) 6 7 8 9 10(max) 11 12
Now as for column 2, 10th value is closer to col1 maximum value, therefore distance is measured in the following way
column 1 
1 2 3 4 5 6 7 8 9 10 11 12(max)        column 2 
12 1 2 3 4 5 6 7 8 9 10(max) 11
a&amp;gt;sum(abs(col1-col2))
---
column 1 
1 2 3 4 5 6 7 8 9 10 11 12(max)        column 2 
11 12 1 2 3 4 5 6 7 8 9 10(max) 
b&amp;gt;sum(abs(col1-col2))
total distance=a+b
How can i do it??
Thankyou very very much in advance
Elisa
       i have the following data arranged in three columns


structure(c(0.492096635764151, 0.433332688044914, 0.521585941816778, 
1.66472272302545, 2.61878329527404, 2.19154489521664, 0.493876245329722, 
0.4915787202584, 0.889477365620806, 0.609135860199222, 0.739201878930367, 
0.854663750519518, 2.06195904001605, 1.41493262330451, 1.35748791897328, 
1.19490680241894, 0.702488756183322, 0.338258418490199, 0.123398398622741, 
0.138548982660226, 0.16170889185798, 0.414543218677095, 1.84629295875002, 
2.24547399004563), .Dim = c(12L, 2L))


The distance is to be calculated by subtracting each value of each column from the corresponding column value in the following way

=&amp;gt;The column values are cyclic. For example, after row 12 there is once again row 1. So, in a way, row 3 is more closer to row 12 than to row 8. 

=&amp;gt; The peak value is the maximum value for any column. the values falling in the range of 80% of the maximum values can also be considered as maximum value provided they are not falling immediatly next to eachother. 

=&amp;gt; If we plot column 1 and column 2 the peak value of column 1 is at 5th grade of x-axis and for column 2 its in 12th. 
For column 2 at x=1 the value is very close to that of the value at x=12 (in 80% range of it), but still it can considered as peak value as it is immediatly falling next to the maximum value. 
Now The peaks are moved towards eachother in a shortest possible way unless maximum values are under eachother
more precisely,

column 1 

1 2 3 4 5(max) 6 7 8 9 10 11 12
        
column 2 

1 2 3 4 5 6 7 8 9 10 11 12(max)

Now distance is measured in the following way

column 1 

1 2 3 4 5(max) 6 7 8 9 10 11 12
        
column 2 

12(max) 1 2 3 4 5 6 7 8 9 10 11 

a&amp;gt;sum(abs(col1-col2))

==
column 1 

1 2 3 4 5(max) 6 7 8 9 10 11 12
        
column 2 

11 12(max) 1 2 3 4 5 6 7 8 9 10  

b&amp;gt;sum(abs(col1-col2))
==
column 1 

1 2 3 4 5(max) 6 7 8 9 10 11 12
        
column 2 

10 11 12(max) 1 2 3 4 5 6 7 8 9 

c&amp;gt;sum(abs(col1-col2))
==
column 1 

1 2 3 4 5(max) 6 7 8 9 10 11 12
        
column 2 

9 10 11 12(max) 1 2 3 4 5 6 7 8 

d&amp;gt;sum(abs(col1-col2))
==
column 1 

1 2 3 4 5(max) 6 7 8 9 10 11 12
        
column 2 

8 9 10 11 12(max) 1 2 3 4 5 6 7 

e&amp;gt;sum(abs(col1-col2))


total distance= a+b+c+d+e

For the following two column it should work the following way


structure(c(0.948228727226247, 1.38569091844218, 0.910510759802679, 
1.25991218521949, 0.993123416952421, 0.553640392997634, 0.357487763503204, 
0.368328033777003, 0.344255688489322, 0.423679560916755, 1.32093576037521, 
3.13420679229785, 0.766278117577654, 0.751997501086888, 0.836280758630117, 
1.188156460303, 1.56771616670373, 1.15928168139479, 0.522523036011874, 
0.561678840701488, 1.11155735914479, 1.26467106348848, 1.09378883406298, 
1.17607018089421), .Dim = c(12L, 2L))

column 1 

1 2 3 4 5 6 7 8 9 10 11 12(max)
        
column 2 

1 2 3 4 5(max) 6 7 8 9 10(max) 11 12

Now as for column 2, 10th value is closer to col1 maximum value, therefore distance is measured in the following way

column 1 

1 2 3 4 5 6 7 8 9 10 11 12(max)
        
column 2 

12 1 2 3 4 5 6 7 8 9 10(max) 11

a&amp;gt;sum(abs(col1-col2))

---

column 1 

1 2 3 4 5 6 7 8 9 10 11 12(max)
        
column 2 

11 12 1 2 3 4 5 6 7 8 9 10(max) 

b&amp;gt;sum(abs(col1-col2))

total distance=a+b

How can i do it..

Thankyou very very much in advance

Elisa
&lt;/pre&gt;</description>
    <dc:creator>eliza botto</dc:creator>
    <dc:date>2013-05-23T20:29:19</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293487">
    <title>glmnet package: command meanings</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293487</link>
    <description>&lt;pre&gt;Hi List,
I have a little confused when to glmnet() vs cv.glmnet().

I know that,
glmnet(): gives the fit
cv.glment(): does the cv after the fit

I just want to get the beta coefficients after the fit, that's it!

But of all the glmnet examples I've seen, the beta coefficient is
obtained ONLY AFTER cv.glmnet().

Why is that?  Also, why is there so many more extra beta's after the fit?

Thanks,
Mike

&lt;/pre&gt;</description>
    <dc:creator>C W</dc:creator>
    <dc:date>2013-05-23T19:44:18</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293481">
    <title>strings</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293481</link>
    <description>&lt;pre&gt;I have two files containing words. I want to print the are in file 1 but
NOT in file 2.
How do I go about?

file 1:
 ABL1
1     ALKBH1
2     ALKBH2
3     ALKBH3
4    ANKRD17
5      APEX1
6      APEX2
7       APTX
8      ASF1A
9      ASTE1
10       ATM
11       ATR
12     ATRIP
13      ATRX
14     ATXN3
15     BCCIP
16       BLM
17     BRCA1
18     BRCA2


file2:
 ALKBH2
1    ALKBH3
2     APEX1
3     APEX2
4      APLF
5      APTX
6       ATM
7       ATR
8     ATRIP
9       BLM
10    BRCA1
11    BRCA2
12    BRIP1
13   BTBD12
14     CCNH

[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>Robin Mjelle</dc:creator>
    <dc:date>2013-05-23T18:04:34</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293474">
    <title>FW: Kernel smoothing with bandwidth which varies with x</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293474</link>
    <description>&lt;pre&gt;Hello all, 

I would like to use the Nadaraya-Watson estimator assuming a Gaussian
kernel: So far I sued the 
library(sm)
library(sm)
x&amp;lt;-runif(5000)
y&amp;lt;-rnorm(5000)
plot(x,y,col='black')
h1&amp;lt;-h.select(x,y,method='aicc')
lines(ksmooth(x,y,bandwidth=h1))

which works fine. What if my data were clustered requiring a bandwidth that
varies with x? How can I do that?

Thanks in advance, 
Ioanna

&lt;/pre&gt;</description>
    <dc:creator>IOANNA</dc:creator>
    <dc:date>2013-05-23T16:10:58</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293468">
    <title>Error in png: unable to start png() device</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293468</link>
    <description>&lt;pre&gt;Hi,
I use R 2.14.0 on Win XP Pro SP3 and it behaves same - some times.
After I draw a lot of plots (more then 200, 2 concurrent rgui processes
running in parallel) to png then I get same error message.
Bmp(), jpg(), png() - same error. Restart of Rgui helps nothing.

Solutin - restart system and voila everything is ok.

I suspect that there might be something wrong with allocation/deallocation
of Windows resources in windows() function.

Ondrej Novak

[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>Ondrej Novak</dc:creator>
    <dc:date>2013-05-23T15:06:12</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293467">
    <title>xml newbie</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293467</link>
    <description>&lt;pre&gt;Dear r-helpers,

I am trying to extract quantities of interest from my iTunes library xml file. Â For example, i'd like to be able to run a simple regression of playcount on track number, under the theory that tracks near the beginning of albums get played more (either because they are "better" or because people listen to the beginnings of albums)

I have an xml file that is of the following form:

&amp;lt;key&amp;gt;13162&amp;lt;/key&amp;gt;
&amp;lt;dict&amp;gt;
&amp;lt;key&amp;gt;Track ID&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;13162&amp;lt;/integer&amp;gt;
&amp;lt;key&amp;gt;Name&amp;lt;/key&amp;gt;&amp;lt;string&amp;gt;I'm A Wheel&amp;lt;/string&amp;gt;
&amp;lt;key&amp;gt;Artist&amp;lt;/key&amp;gt;&amp;lt;string&amp;gt;Wilco&amp;lt;/string&amp;gt;
&amp;lt;key&amp;gt;Composer&amp;lt;/key&amp;gt;&amp;lt;string&amp;gt;Jeff Tweedy&amp;lt;/string&amp;gt;
&amp;lt;key&amp;gt;Album&amp;lt;/key&amp;gt;&amp;lt;string&amp;gt;A Ghost is Born&amp;lt;/string&amp;gt;
&amp;lt;key&amp;gt;Genre&amp;lt;/key&amp;gt;&amp;lt;string&amp;gt;Rock&amp;lt;/string&amp;gt;
&amp;lt;key&amp;gt;Kind&amp;lt;/key&amp;gt;&amp;lt;string&amp;gt;Matched AAC audio file&amp;lt;/string&amp;gt;
&amp;lt;key&amp;gt;Size&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;6248701&amp;lt;/integer&amp;gt;
&amp;lt;key&amp;gt;Total Time&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;154648&amp;lt;/integer&amp;gt;
&amp;lt;key&amp;gt;Disc Number&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;1&amp;lt;/integer&amp;gt;
&amp;lt;key&amp;gt;Disc Count&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;1&amp;lt;/integer&amp;gt;
&amp;lt;key&amp;gt;Track Number&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;9&amp;lt;/integer&amp;gt;
&amp;lt;key&amp;gt;Track Count&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;12&amp;lt;/integer&amp;gt;
&amp;lt;key&amp;gt;Year&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;2004&amp;lt;/integer&amp;gt;
&amp;lt;key&amp;gt;Date Modified&amp;lt;/key&amp;gt;&amp;lt;date&amp;gt;2012-07-26T22:29:15Z&amp;lt;/date&amp;gt;
&amp;lt;key&amp;gt;Date Added&amp;lt;/key&amp;gt;&amp;lt;date&amp;gt;2010-01-27T00:02:21Z&amp;lt;/date&amp;gt;
&amp;lt;key&amp;gt;Bit Rate&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;256&amp;lt;/integer&amp;gt;
&amp;lt;key&amp;gt;Sample Rate&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;44100&amp;lt;/integer&amp;gt;
&amp;lt;key&amp;gt;Play Count&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;3&amp;lt;/integer&amp;gt;
&amp;lt;key&amp;gt;Play Date&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;3434905791&amp;lt;/integer&amp;gt;
&amp;lt;key&amp;gt;Play Date UTC&amp;lt;/key&amp;gt;&amp;lt;date&amp;gt;2012-11-05T00:29:51Z&amp;lt;/date&amp;gt;
&amp;lt;key&amp;gt;Artwork Count&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;1&amp;lt;/integer&amp;gt;
&amp;lt;key&amp;gt;Sort Album&amp;lt;/key&amp;gt;&amp;lt;string&amp;gt;Ghost is Born&amp;lt;/string&amp;gt;
&amp;lt;key&amp;gt;Persistent ID&amp;lt;/key&amp;gt;&amp;lt;string&amp;gt;A8B0E5CF2E86A4C6&amp;lt;/string&amp;gt;
&amp;lt;key&amp;gt;Track Type&amp;lt;/key&amp;gt;&amp;lt;string&amp;gt;File&amp;lt;/string&amp;gt;
&amp;lt;key&amp;gt;Location&amp;lt;/key&amp;gt;&amp;lt;string&amp;gt;file://localhost/Users/Alex/Music/iTunes/iTunes%20Media/Music/Wilco/A%20Ghost%20is%20Born/09%20I'm%20A%20Wheel.m4a&amp;lt;/string&amp;gt;
&amp;lt;key&amp;gt;File Folder Count&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;5&amp;lt;/integer&amp;gt;
&amp;lt;key&amp;gt;Library Folder Count&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;1&amp;lt;/integer&amp;gt;
&amp;lt;/dict&amp;gt;Â 


From each entry, i'd like to extract: Track ID, Track Number and Play Count. Â In this case, it would beÂ 

13162, 9, 3

my guess is that this can be done using library(XML).

If anyone has any guidance, it would be appreciated. Â Please note:Â 

a) I do not understand XML data structures, so please explain what you mean by "children" etcâ¦
b) Not every entry in my database has a track number and a play count -- i'd like to have NAs associated with the appropriate Track ID, which all entries have.
c) it'd also be OK if this XML database just got turned into a normal r data frame.

Thanks!
[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>Alexander Coppock</dc:creator>
    <dc:date>2013-05-23T14:31:21</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293463">
    <title>Could graph objects be stored in a "two-dimensional list"?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293463</link>
    <description>&lt;pre&gt;Hi,

  I have a few graph objects created by some graphic package (say, ggplot2,
which I use frequently). Because of the existent relation between the
graphs, I'd like to index them in two dimensions as p[1,1], p[1,2], p[2,1],
p[2,2] for convenience.

  To my knowledge, the only data type capable of storing graph objects (and
any R object) is list, but unfortunately it is available in only one
dimension. Could the graphs be stored in any two-dimensional data type?

  One remedy that comes to my mind is to build a function f so that
f(1,1)=1
f(1,2)=2
f(2,1)=3
f(2,2)=4
  With functions f and f^{-1} (inverse function of f) , the two-dimensional
indices could be mapped to and from a set of one-dimensional indices, and
the functions are exactly the way R numbers elements in a matrix. Does R
have this built-in function for a m by n matrix or more generally, m*n*p
array? (I know this function is easy to write, but just want to make sure
whether it exists already)

   Thanks,

Miao

[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>jpm miao</dc:creator>
    <dc:date>2013-05-23T15:30:11</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293459">
    <title>error message solution: cannot allocate vector of size 200Mb</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293459</link>
    <description>&lt;pre&gt;Dear All,

I wrote a program using R 2.15.2 but this error message "cannot allocate
vector of size 200Mb" appeared. I want to ask in general how to handle this
situation. I try to run the same program on other computers. It is
perfectly fine. Can anybody help? Thank you very much in advance.

Best Regards,
Ray

[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>Ray Cheung</dc:creator>
    <dc:date>2013-05-23T14:53:31</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293457">
    <title>Removing rows w/ smaller value from data frame</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293457</link>
    <description>&lt;pre&gt;Hello,

I have a column called max_date in my data frame and I only want to keep the
bigger values for the same activity.  How can I do that?

data frame:

activity    max_dt
A            2013-03-05
B             2013-03-28
A             2013-03-28
C             2013-03-28
B             2013-03-01

Thank you for your help



--
View this message in context: http://r.789695.n4.nabble.com/Removing-rows-w-smaller-value-from-data-frame-tp4667816.html
Sent from the R help mailing list archive at Nabble.com.

&lt;/pre&gt;</description>
    <dc:creator>ramoss</dc:creator>
    <dc:date>2013-05-23T14:23:58</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293443">
    <title>SEM: multigroup model</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293443</link>
    <description>&lt;pre&gt;Dear R Gurus,

I am trying to run a multigroup SEM using Prof. John Fox's SEM package.

The two groups are "Ready to Eat" denoted by RTE and
                            "Ready to Cook" denoted by RTC.

I ran a omnibus CFA on the data of consumer perceptions &amp;amp; preferences and
am satisfied with what I got.

When I tried to do a multigroup SEM - my understanding is limited to the
SEM manual in CRAN - using the code below, I get the following message:
          Error in summary.msemObjectiveML(sem.MG) :
                         no 'dimnames' attribute for array
           Execution halted

The relevant part of my code follows:
mod.mg &amp;lt;- multigroupModel(sbmod.cfa,groups=c("RTC","RTE"))

sem.MG &amp;lt;- sem(mod.mg,data=srt,group="RTind",
          formula = ~ inv + imp + tch + emo + loy + usg + sig + dif + ndif
+
            vda + vdb + vdc + vdd + vde + vdf + vdg + vdh +
            riskT + riskP + riskS + riskFi + riskFu + riskPs

        )
summary(sem.MG)

I was expecting two sets of fit indices for RTE &amp;amp; RTC and want to do an
ANOVA
across the models; as well as possibly check for loading equivalence.

Can somebody please throw some light on where I am making a mistake?

Thanks
Amarnath Bose
&lt;/pre&gt;</description>
    <dc:creator>Amarnath Bose</dc:creator>
    <dc:date>2013-05-23T10:53:38</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293438">
    <title>Transform Coordinate System of an ASCII-Grid</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293438</link>
    <description>&lt;pre&gt;Dear all,


I have an ASCII-Grid for Switzerland in the Swiss National Coordinate System
of CH1903. Now for a Webapplication of the ASCII-Grid, I need to deliver the
ASCII-Grid in the WGS84 System.

Via coordinates(ascii) I can "export" the coordinates and convert them with
a formula into WGS84. My problem is now, how can I implement these into the
ASCII-Grid, so that the whole grid-structure is from now on gonna be saved
in the WGS84-coordinate format?
(important: I don't want to change the projection, I want to actually change
the numeric format of the coordinates)

Thank you so much for your help,
jas



--
View this message in context: http://r.789695.n4.nabble.com/Transform-Coordinate-System-of-an-ASCII-Grid-tp4667786.html
Sent from the R help mailing list archive at Nabble.com.

&lt;/pre&gt;</description>
    <dc:creator>jas</dc:creator>
    <dc:date>2013-05-23T07:44:46</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293431">
    <title>convert a character string to a name</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293431</link>
    <description>&lt;pre&gt;Hi,
   From time to time I need to do the aggregation. To illustrate, I present
a toy example as below. In this example, the task is to aggregate x and y
by z with the function mean.
   Could I call the aggregation function with x_test, where
   x_test=c("x","y")? Thanks

Miao


    x y z
1   1 1 1
2   2 2 0
3   3 3 1
4   4 0 0
5   5 1 1
6   6 2 0
7   7 3 1
8   8 0 0
9   9 1 1
10 10 2 0
11 11 3 1
12 12 0 0
  z x y
1 0 7 1
2 1 6 2
Error in model.frame.default(formula = cbind(x_test) ~ z, data = dftest) :
  variable lengths differ (found for 'z')
a1aggregate(cbind(factor(x_test))~z, data=dftest, FUN=mean)
Error in model.frame.default(formula = cbind(factor(x_test)) ~ z, data =
dftest) :
  variable lengths differ (found for 'z')
Error in model.frame.default(formula = factor(x_test) ~ z, data = dftest) :
  variable lengths differ (found for 'z')

[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>jpm miao</dc:creator>
    <dc:date>2013-05-23T07:05:19</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293425">
    <title>adding rows without loops</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293425</link>
    <description>&lt;pre&gt;I'm comparing a variety of datasets with over 4M rows.  I've solved this
problem 5 different ways using a for/while loop but the processing time is
murder (over 8 hours doing this row by row per data set).  As such I'm
trying to find whether this solution is possible without a loop or one in
which the processing time is much faster.

Each dataset is a time series as such:

DF1:

    X.DATE X.TIME VALUE VALUE2
1 01052007   0200    37     29
2 01052007   0300    42     24
3 01052007   0400    45     28
4 01052007   0500    45     27
5 01052007   0700    45     35
6 01052007   0800    42     32
7 01052007   0900    45     32
.
.
.
n

DF2

    X.DATE X.TIME VALUE VALUE2
1 01052007   0200    37     29
2 01052007   0300    42     24
3 01052007   0400    45     28
4 01052007   0500    45     27
5 01052007   0600    45     35
6 01052007   0700    42     32
7 01052007   0800    45     32

.
.
n+4000

In other words there are 4000 more rows in DF2 then DF1 thus the datasets
are of unequal length.

I'm trying to ensure that all dataframes have the same number of X.DATE and
X.TIME entries.  Where they are missing, I'd like to insert a new row.

In the above example, when comparing DF2 to DF1, entry 01052007 0600 entry
is missing in DF1.  The solution would add a row to DF1 at the appropriate
index.

so new dataframe would be


    X.DATE X.TIME VALUE VALUE2
1 01052007   0200    37     29
2 01052007   0300    42     24
3 01052007   0400    45     28
4 01052007   0500    45     27
5 01052007   0600    45     27
6 01052007   0700    45     35
7 01052007   0800    42     32
8 01052007   0900    45     32

Value and Value2 would be the same as row 4.

Of course this is simple to accomplish using a row by row analysis but with
of 4M rows the processing time destroying and rebinding the datasets is
very time consuming and I believe highly un-R'ish.  What am I missing?

Thanks!

[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>Adeel Amin</dc:creator>
    <dc:date>2013-05-23T05:00:50</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293420">
    <title>Sort data by month</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293420</link>
    <description>&lt;pre&gt;Hello,
I have a 'zoo' object containing dates [dd/mm/yr] in the first column and values in the second column.
I tried as.Date but did not succeed.
Here is an example of date format
 01/01/2000

01/02/2000
...
01/12/2000
01/01/2001
01/02/2001

...
01/12/2000
  etc.
I would like to sort all Jans from 2000 to 2010, all Febs from 2000 to 2010 ... all Decs from 2000 to 2010.
So, basically I would like to sort by month.

Thanks for your help.
Atem.

[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>Zilefac Elvis</dc:creator>
    <dc:date>2013-05-23T03:11:40</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293419">
    <title>sample(c(0, 1)...) vs. rbinom</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293419</link>
    <description>&lt;pre&gt;Greetings.  My wife is teaching an introductory stat class at UC Davis.  The
class emphasizes the use of simulations, rather than mathematics, to get
insight into statistics, and R is the mandated tool.   A student in the class
recently inquired about different approaches to sampling from a binomial
distribution.  I've appended some code that exhibits the idea, the gist of
which is that using sample(c(0, 1), ...) and rbinom(...) should give
equivalent results.

The surprising (to me) result is that the two approaches DO give the same
result, EXCEPT when the probability is exactly 0.5.  See Appendix A for the
code and Appendix B for the output.  I don't think this issue is
system-dependent, but I've put my session information in Appendix C.

Another wrinkle in this is that if I omit the "prob" parameter from the call
to sample, meaning to take the default value of 0.5, the two methods DO give
the same result.

Any thoughts about this?  Thanks.

--Mike

Appendix A: some R code that exhibits the problem
=================================================

ppp &amp;lt;- seq(0, 1, by = 0.01)

result &amp;lt;- do.call(rbind, lapply(ppp, function(p) {
    set.seed(1)
    sampleRes &amp;lt;- sample(c(0, 1), size = 1, replace = TRUE,
                        prob=c(1-p, p))
    
    set.seed(1)
    rbinomRes &amp;lt;- rbinom(1, size = 1, prob = p)
    
    data.frame(prob = p, equivalent = all(sampleRes == rbinomRes))
    
}))

result


Appendix B: the output from the R code
======================================

    prob equivalent
1   0.00       TRUE
2   0.01       TRUE
3   0.02       TRUE
4   0.03       TRUE
5   0.04       TRUE
6   0.05       TRUE
7   0.06       TRUE
8   0.07       TRUE
9   0.08       TRUE
10  0.09       TRUE
11  0.10       TRUE
12  0.11       TRUE
13  0.12       TRUE
14  0.13       TRUE
15  0.14       TRUE
16  0.15       TRUE
17  0.16       TRUE
18  0.17       TRUE
19  0.18       TRUE
20  0.19       TRUE
21  0.20       TRUE
22  0.21       TRUE
23  0.22       TRUE
24  0.23       TRUE
25  0.24       TRUE
26  0.25       TRUE
27  0.26       TRUE
28  0.27       TRUE
29  0.28       TRUE
30  0.29       TRUE
31  0.30       TRUE
32  0.31       TRUE
33  0.32       TRUE
34  0.33       TRUE
35  0.34       TRUE
36  0.35       TRUE
37  0.36       TRUE
38  0.37       TRUE
39  0.38       TRUE
40  0.39       TRUE
41  0.40       TRUE
42  0.41       TRUE
43  0.42       TRUE
44  0.43       TRUE
45  0.44       TRUE
46  0.45       TRUE
47  0.46       TRUE
48  0.47       TRUE
49  0.48       TRUE
50  0.49       TRUE
51  0.50      FALSE
52  0.51       TRUE
53  0.52       TRUE
54  0.53       TRUE
55  0.54       TRUE
56  0.55       TRUE
57  0.56       TRUE
58  0.57       TRUE
59  0.58       TRUE
60  0.59       TRUE
61  0.60       TRUE
62  0.61       TRUE
63  0.62       TRUE
64  0.63       TRUE
65  0.64       TRUE
66  0.65       TRUE
67  0.66       TRUE
68  0.67       TRUE
69  0.68       TRUE
70  0.69       TRUE
71  0.70       TRUE
72  0.71       TRUE
73  0.72       TRUE
74  0.73       TRUE
75  0.74       TRUE
76  0.75       TRUE
77  0.76       TRUE
78  0.77       TRUE
79  0.78       TRUE
80  0.79       TRUE
81  0.80       TRUE
82  0.81       TRUE
83  0.82       TRUE
84  0.83       TRUE
85  0.84       TRUE
86  0.85       TRUE
87  0.86       TRUE
88  0.87       TRUE
89  0.88       TRUE
90  0.89       TRUE
91  0.90       TRUE
92  0.91       TRUE
93  0.92       TRUE
94  0.93       TRUE
95  0.94       TRUE
96  0.95       TRUE
97  0.96       TRUE
98  0.97       TRUE
99  0.98       TRUE
100 0.99       TRUE
101 1.00       TRUE

Appendix C: Session information
===============================

R version 3.0.0 (2013-04-03)
Platform: x86_64-redhat-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=C                 LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

&lt;/pre&gt;</description>
    <dc:creator>Michael Hannon</dc:creator>
    <dc:date>2013-05-23T02:54:01</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293418">
    <title>(no subject)</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293418</link>
    <description>&lt;pre&gt;Dear Bernhard,



I am using your R package var. I am interested in running impulse
response analysis (using irf) and error variance decomposition (using
fevd).



I have two questions:

-What decomposition method do you use in your package  Cholesky?

-What is the order of entry of the variables  the same as in the data set
being analyzed?



Thank you very much!

 Dimitri Liakhovitski

[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>Dimitri Liakhovitski</dc:creator>
    <dc:date>2013-05-22T23:17:23</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293413">
    <title>group data based on row value</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293413</link>
    <description>&lt;pre&gt;hey, I want to divide my data into three groups based on the value in one
column with group name.

dat:

Var
0
0.2
0.5
1
4
6

I tried:

dat &amp;lt;- cbind(dat, group=cut(dat$Var, breaks=c(0.1,0.6)))

But it doesnt work, I want to group those &amp;lt;0.1 as group A, 0.1-0.6 as group
B, &amp;gt;0.6 as group C

Thanks for your help!

[[alternative HTML version deleted]]

&lt;/pre&gt;</description>
    <dc:creator>Ye Lin</dc:creator>
    <dc:date>2013-05-22T21:40:48</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.lang.r.general/293408">
    <title>Linebreaks in cat() functions that call other variables?</title>
    <link>http://comments.gmane.org/gmane.comp.lang.r.general/293408</link>
    <description>&lt;pre&gt;Hi everyone,

I'm having some difficulty getting the linebreaks I want with the cat()
function.

I currently have the following function:

lab1&amp;lt;-function(iv,dv){
  a&amp;lt;-anova(lm(dv~iv))
  cat("df(between) is",a[1,1])
  cat("df(within) is", a[2,1])
  cat("ss(between) is", a[1,2])
  cat("ss(within) is", a[2,2])
}

And I want my output to be:

df(between) is 4
df(within) is 45
ss(between) is 232
ss(within) is 400

but instead it prints:
df(between) is 4df(within) is 45ss(between) is 232ss(within) is 400


I have seen other people ask about this issue, but only in the context of
character strings. I understand that if i wanted the output:

Happy birthday
to you 

the correct input would be

However applying the same logic to my string returns an error:
Error: unexpected input in "cat("df(between) is",a[1,1],\"
Error: unexpected input in "cat("df(between) is",a[1,1]\"

Adding the command 'sep="\n"' to the end of each cat() returns:

df(between) is 
4
df(within) is 
45
ss(between) is 
232
ss(within) is 
400

which is not quite as ugly, but I would still prefer the 4 line format I
posted at the beginning.

Can anyone help?



--
View this message in context: http://r.789695.n4.nabble.com/Linebreaks-in-cat-functions-that-call-other-variables-tp4667748.html
Sent from the R help mailing list archive at Nabble.com.

&lt;/pre&gt;</description>
    <dc:creator>jordanbrace</dc:creator>
    <dc:date>2013-05-22T20:34:34</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>
