Re: [R] Need help

2008-10-28 Thread Tal Galili
Hello John.After a simple search in google, I came up with this:
http://www.ats.ucla.edu/stat/R/seminars/Repeated_Measures/repeated_measures.htm

Enjoy,
Tal.



On Mon, Oct 27, 2008 at 6:15 PM, JohnLi [EMAIL PROTECTED] wrote:

 Hi All,

   I am new comer here and for Statistics R. I want to know how to use R
 to calculate one way repeated measure ANOVA, for example, on three
 groups of data.

   I appreciate if someone can help me solve this problem.


 John

 __
 R-help@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.




-- 
--
Tal Galili
Phone number: 972-50-3373767
FaceBook: Tal Galili
My Blogs:
www.talgalili.com
www.biostatistics.co.il

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] License Question

2008-10-28 Thread rplus

   Hi Duncan,



   Yes we do follow the legal terms very carefully and make sure our general
   counsel reviews all these stuff.

   To answer your question, we do not distribute R.  We distribute  R-PLUS.



   When users ask us about  'R license', it usually refers to potential hidden
   costs. However you are right that explaining the GPL terms is paramount.



   Thanks -





   R-PLUS Team
24 Hours Tech Support
Think Fast, Think Big, Without The High Cost!
   [1]www.Experience-Rplus.com/Conference.asp
USAR2009, Las Vegas USA R|Rplus Conference.
April 26-30, 2009 !



    Original Message 
   Subject: Re: [R] License Question
   From: Duncan Murdoch [EMAIL PROTECTED]
   Date: Mon, October 27, 2008 6:59 pm
   To: [EMAIL PROTECTED]
   Cc: r-help@r-project.org
   [EMAIL PROTECTED] wrote:
Katrin,
   
   
   
R is completely free - no License. We've built a supported user friendly
version: R-PLUS
   
   This statement is not correct. R is licensed under the GPL. This is a
   free software license, but it is not the same as having no license.
   There are obligations under the GPL that anyone who distributes GPL'd
   software should be aware of.
   Does XL Solutions distribute R? Does it follow its obligations under
   the GPL?
   Duncan Murdoch
You can freely evaluate R-PLUS - the current free trial has no expiration
date.
   
   
   
At a click, import data from different formats, use Excel-like
spreadsheet for manipulating your data, create publication-quality
reports, generate editable graphics ... and click click to run your
favorite models through dialogs.
Check out the screenshots at [2]www.Experience-Rplus.com and tell us
what you think. Register for free trial.
   
   
   
R-PLUS Team
   
24 Hours Tech Support
   
Think Fast, Think Big, Without The High Cost!
   
[1][3]www.Experience-Rplus.com/Conference.asp
   
USAR2009, Las Vegas USA R|Rplus Conference.
   
April 26-30, 2009 !
   
   
   
--- On Mon, 10/27/08, Freiberger, Katrin [EMAIL PROTECTED]
wrote:
   
 From: Freiberger, Katrin [EMAIL PROTECTED]
 Subject: [R] License Question
 To: [EMAIL PROTECTED]
 Date: Monday, October 27, 2008, 6:04 AM
 Dear All,

 I learned about R during my studies at Cologne University
 of Applied Science. Now I work at Allianz Dresdner Bauspar
 AG and I would like to install R here too. Is there any
 license issues that need to be taken in consideration, any
 fees to pay by the company? I know there are answers to this
 in the FAQs but I didn't really understand the legal
 language. Could you therefore just give me concrete answers?

 Thanks for you help  kind regards,

 Katrin Freiberger

 __
 [EMAIL PROTECTED] mailing list
 [6][4]https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 [7][5]http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained,
 reproducible code.
   
References
   
Visible links
1. [6]http://www.experience-rplus.com/Conference.asp
2. [7]mailto:[EMAIL PROTECTED]
3. [8]mailto:[EMAIL PROTECTED]
4. [9]mailto:r-help@r-project.org
5. [10]mailto:R-help@r-project.org
6. [11]https://stat.ethz.ch/mailman/listinfo/r-help
7. [12]http://www.r-project.org/posting-guide.html
   
Hidden links:
8. [13]http://www.experience-rplus.com/Conference.asp
__
R-help@r-project.org mailing list
[14]https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
   [15]http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
   

References

   1. http://www.Experience-Rplus.com/Conference.asp
   2. http://www.Experience-Rplus.com/
   3. http://www.Experience-Rplus.com/Conference.asp
   4. https://stat.ethz.ch/mailman/listinfo/r-help
   5. http://www.R-project.org/posting-guide.html
   6. http://www.experience-rplus.com/Conference.asp
   7. http://email01.secureserver.net/pcompose.php#Compose
   8. http://email01.secureserver.net/pcompose.php#Compose
   9. http://email01.secureserver.net/pcompose.php#Compose
  10. http://email01.secureserver.net/pcompose.php#Compose
  11. https://stat.ethz.ch/mailman/listinfo/r-help
  12. http://www.r-project.org/posting-guide.html
  13. http://www.experience-rplus.com/Conference.asp
  14. https://stat.ethz.ch/mailman/listinfo/r-help
  15. http://www.R-project.org/posting-guide.html
__
R-help@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.


Re: [R] repeated measure one way anova

2008-10-28 Thread Dieter Menne
JohnLi jli136 at site.uottawa.ca writes:
 I am a new comer for Statistics R. I am using R for one way repeated
 measure anova, for example, on the following data consisting of three
 groups.
 
 
 c2c3  c4
 85.83 75.86   84.19
 85.91 73.18   85.9

-- Arrange your data in the long form. Do it by hand, or use function pack, or
reshape, or package reshape.

(Assuming these are times. If these are categorical variables, better use
strings as column descriptors)



subj time conc(do not use t or c as variable name, these are 
  well-known functions in R) 
A 285.83
A 375.86
A 484.19
B 285.91


Use package nlme, function lme. It might be a bit of an overkill for the simple
case, but always worth the effort when things get more complex

libary(nlme)
summary(lme(c~time, random=~1|subj,data=mydata)

Dieter

__
R-help@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.


Re: [R] Transferring results from R to MS Word

2008-10-28 Thread Dieter Menne
Tom Backer Johnsen backer at psych.uib.no writes:

 There 
 are also some parts of the documentation that I do not understand.  The 
 list of functions includes things like HTML.lm, as far as I can see are 
 invisible, both in respect to documentation and usage.

This might be relic of a function written by my some year ago, which were part
of the distribution for some time, but probably removed later.

Dieter

__
R-help@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.


Re: [R] repeated measure one way anova

2008-10-28 Thread Peter Dalgaard

Dieter Menne wrote:

JohnLi jli136 at site.uottawa.ca writes:

I am a new comer for Statistics R. I am using R for one way repeated
measure anova, for example, on the following data consisting of three
groups.


c2  c3  c4
85.83   75.86   84.19
85.91   73.18   85.9


-- Arrange your data in the long form. Do it by hand, or use function pack, or
reshape, or package reshape.

(Assuming these are times. If these are categorical variables, better use
strings as column descriptors)



subj time conc(do not use t or c as variable name, these are 
  well-known functions in R) 
A 285.83

A 375.86
A 484.19
B 285.91


Use package nlme, function lme. It might be a bit of an overkill for the simple
case, but always worth the effort when things get more complex

libary(nlme)
summary(lme(c~time, random=~1|subj,data=mydata)


There is also anova.mlm:

d - read.table(clipboard, header=T)
Y - as.matrix(d)
fit1 - lm(Y~1)
fit0 - lm(Y~0)
anova(fit0, fit1, X=~1, test=Spherical)
anova(fit0, fit1, X=~1, test=Wilks)

--
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
R-help@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.


Re: [R] Computational problems in R

2008-10-28 Thread Robin Hankin

Hello.

The Brobdingnag package uses that identity for a logarithmic
representation and also has a hack for negative numbers.


HTH

rksh



A.Noufaily wrote:
 
Many thanks for your suggestions...


I am still checking which one is the most useful for my simulations.

Concerning using logs, this might be very helpful, but I am not sure if
I can use the following:
A+B = A*(1 + B/A)
= exp(log(A) + log(1 + B/A))
because unfortunately B can be negative.
However, I might still use logs in case (1 + B/A)0.

Regards,
 
Amy


-Original Message-
From: Duncan Murdoch [mailto:[EMAIL PROTECTED] 
Sent: Saturday, October 25, 2008 11:36 AM

To: Steven McKinney
Cc: A.Noufaily; r-help@r-project.org
Subject: Re: [R] Computational problems in R

On 24/10/2008 9:50 PM, Steven McKinney wrote:
  

I suspect there's a deeper issue here.
sum(exp(yi)) when large yi occur is
problematic.  exp(yi) for yi710 is
just a huge number, and summing additional values only makes the 
overall sum larger as all components of the summation are positive.

There's no way around that.



Sure there is, and you quoted it below.  Work on a log scale.  The log
of exp(yi) is yi, and it sounds as though the yi values are manageable.

You might end up knowing that the log of the final answer is 2 and
not be able to evaluate exp(2) in R, but you still know that the
answer is exp(2).

Duncan Murdoch
  

You could try this with Robin Hankins'
package brobdingnag which can handle bunches of bizarrely large 
numbers.


What kind of process are you studying?
What kind of process generates values
such as exp(8/0.01) when other values
are much smaller?  Are these outliers
in an otherwise well-behaved
data set?  Perhaps then they need
to be set aside and investigated
separately, etc.


Steven McKinney

Statistician
Molecular Oncology and Breast Cancer Program British Columbia Cancer 
Research Centre


email: smckinney +at+ bccrc +dot+ ca

tel: 604-675-8000 x7561

BCCRC
Molecular Oncology
675 West 10th Ave, Floor 4
Vancouver B.C. 
V5Z 1L3

Canada




-Original Message-
From: [EMAIL PROTECTED] on behalf of Duncan Murdoch
Sent: Fri 10/24/2008 4:04 PM
To: A.Noufaily
Cc: r-help@r-project.org
Subject: Re: [R] Computational problems in R
 
On 24/10/2008 12:42 PM, A.Noufaily wrote:


Dear all,

I would be grateful if anyone can help me with the following:

My aim is to compute explicitely the sum S=A+B where 
A=sum(exp(c_i/d)), i=1,...,n; B, c_i, and d are real numbers with 
-InfB,c_i+Inf; and d0.

The problem is that when c_i/d 710 (for some i) R is setting
exp(c_i/d) to be equal to +Inf and hence the whole summation S.
So in simple cases where for example c_i=8 (for some i), and d=0.01 
the whole summation is turning out to be infinite.

Is there a way to get round that in R?
Can anyone suggest any computational trick to calculate S when 
c_i/d710 (for some i)?
  

Work on a log scale.  Use the identity that

A+B = A*(1 + B/A)
 = exp(log(A) + log(1 + B/A))

(where you chose A to be the biggest term in the sum).

Duncan Murdoch



Any suggestions would be much appreciated.

Regards,

Amy





-
The Open University is incorporated by Royal Charter (RC 000391), an
  

exempt charity in England  Wales and a charity registered in Scotland
(SC 038302).
  

[[alternative HTML version deleted]]

__
R-help@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.
  

__
R-help@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.

__
R-help@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.




-
The Open University is incorporated by Royal Charter (RC 000391), an exempt charity 
in England  Wales and a charity registered in Scotland (SC 038302).

__
R-help@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.



__
R-help@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.


Re: [R] help on package or code for simutaneous equation probit(logit) model

2008-10-28 Thread Arne Henningsen
On Tuesday 28 October 2008 03:26:31, Yong Wang wrote:
 Dear List
 I am trying to fit a simutaneous equation logit model. i.e., the
 response variables of the structured equations are binomial, I am not
 sure if systemfit can do this job. 

No, systemfit cannot do this.

 A google search doesn't yield too 
 much helpful information. Your knowledge on any other packages or
 codes are appreciated.

I know that the VGAM package (on CRAN) can estimate bivariate probit models, 
but I don't know if it can estmate also multivariate logit models.

Arne

-- 
Arne Henningsen
http://www.arne-henningsen.name

__
R-help@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.


Re: [R] License Question

2008-10-28 Thread Barry Rowlingson
2008/10/28  [EMAIL PROTECTED]:

   To answer your question, we do not distribute R.  We distribute  R-PLUS.

 But your web site claims, in big capital letters, that R-plus is THE
REAL R. If you are not distributing R (the real real R, (c) The R
Foundation), then this could be construed as false advertising.

 So I'm guessing that R-plus must be an add-on to the real real R, in
which case you can't distribute R with R-plus under a non-free
license. You can unbundle it though, and tell your users to 'first go
get R'. I can't find an installation guide or a decent FAQ that
confirms this. As a non-lawyer, I'd advise you to remove 'The Real R'
from the web site and instead put 'Works With The Real R'. And explain
this in the FAQ. And give a link to www.r-project.org.

 Oh, btw, I'd fix your blog links: go to:
http://www.experience-rplus.com/blog.asp?b=act  and click a
screenshot...

Barry

__
R-help@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.


Re: [R] Transferring results from R to MS Word

2008-10-28 Thread Tom Backer Johnsen

Dieter Menne wrote:

Tom Backer Johnsen backer at psych.uib.no writes:

There 
are also some parts of the documentation that I do not understand.  The 
list of functions includes things like HTML.lm, as far as I can see are 
invisible, both in respect to documentation and usage.


This might be relic of a function written by my some year ago, which were part
of the distribution for some time, but probably removed later.


Hmm.  If that is true, that is not very promising.  It could indicate 
that the maintenace of the package might be patchy.


Tom

__
R-help@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.


Re: [R] License Question

2008-10-28 Thread Tom Backer Johnsen

David Smith wrote:

Hi Tom,

We're in the process of updating the information on our website for 
academic users, but in general we're making RPro available to academic 
users free of charge.  I'm just gathering the information from the 
department in charge of the academic program, and I'll make a public 
reply to r-help when I get that info.  Just wanted to respond to your 
question directly in the interim.


Thanks.  I am looking forward to more information.


RPro isn't going the route of a closed menu approach -- it's the same R 
command-line and script mode you're used to from R.  We're focussing 
more on performance, parallel computation, and additional packages.


Good.  On the other hand, this sounds like it is (or will be) somewhat 
similar to the interfaces that already are avialble, e.g. Tinn-R or 
Rcmdr.  So, what are the advantages?


I'd be happy to answer any other questions you might have of RPro -- 
feel free to call or email.


Thank you.

Tom

__
R-help@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.


[R] a combind problem with list

2008-10-28 Thread tedzzx

Hi all,

I came across a combinding promblem.
suppose I have got a list:
#we got three elements in this list and each elements is a dataframe
s-lapply(1:3,funtion(i){data.frame(mean=numeric(),median=numeric())}) 
 
using the inside data in R:  a-state.x77
f-function(x){c(mean=mean(x),median=(x))}
g-t(apply(a,2,f))
#g is a data frame 
# now I want to combind the first row of g with the first list element of s.
Note that the first elemment of #list g is data frame. Besides, these two
dataframe have the same column names.
s[[1]]-rbind(s[[1]],g[1,])
The result is supposed to be a data frame with the column names: mean,
median , but actually I have got the wrong column names. 
Why?

Besides, in the function :f-function(x){c(mean=mean(x),median=(x))}, why we
use c() here?
why not write the function like this:
f-function(x){mean=mean(x)
median=(x)
}
I just copy this function.

Thanks advance

Ted


-- 
View this message in context: 
http://www.nabble.com/a-combind-problem-with-list-tp20202923p20202923.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


Re: [R] Stuck with FFT

2008-10-28 Thread Rthoughts

EDIT: to assist you to assist me in turn, for which I am grateful, more
detail than the below needs to be provided.

I open tables and view them using Rcmdr so they become active datasets. I am
assuming that x101, x100, etc, are column headings because when the dataset
is edited they can be changed in numerical or non-numerical values. Lets
assume I change those column headings to VB! and V2, and I would like the
output to appear in V3. V2 contains the values to be fft'd. These are
practise values of 24h length sinusoids thus if a sinusoid is viewed as a
frequency value and the time-series are hourly values where periodicity, not
amplitude, counts, this is a 24hr frequency time-series fo hourly values.

Here's an example table (to keep it simple, there are 2 columns, V1 for the
24h frequency values, and V2 for fft output, I don not understand the fft
function enough yet if V1 should contain date/ time values and if V2 should
contain the array, and V3 the output values);

The table name, I assume, since it appears in the window border and taskbar,
is 'Dataset'.

   V1 V2
1 105
2 115
3 140
4 180
5 230
6 300
7 360
8 418
9 450
10 480
11 495
12 500
13 495
14 480
15 450
16 410
17 360
18 300
19 230
20 180
21 140
22 115
23 105
24 100
25 105
26 115
27 140
28 180
29 230
30 300
31 360
32 410
33 450
34 480
35 495
36 500
37 495
38 480
39 450
40 410
41 360
42 300
43 230
44 180
45 140
46 115
47 105
48 100

This is open as a table by view command. How do I go about fft'ing this?

If I can do this I can then in turn try to analyse my real radon data which
are hourly time-series (thus is a disctrete and periodic array). I have to
analyse it for periodicities that can be attributed to 24hr and 24.8hr tidal
cycles to confirm the substance of the first aim of my research.

Secondly, how can I view the output as a graph? I am expecting a frequency
domain from the time domain, thus a frequency of a certain amplitude should
be produced.

Thank you very much. I hope this clears the matter up a bit. If not, I am
happy to provide more details.





Rthoughts wrote:
 
 Dear all,
 
 Before I can get into serious Fourier analysis of Radon time-series I am
 practising with 24hour and 24.8hour sinusoids to assist with my
 interpretation of signals ittributed to tidal input to Radon time series.
 
 I am stuck. I have tried researching this to no avail. I am awating a book
 that should describe fourier transforms in detail and another one that
 should discuss the R application.
 
 I know what the command line is but I can't get it to refer to the array.
 
 What is 'z'? If I have a table open entitled '24hsinusoids' with date/
 time column by the hour from January 01 2008 00:00 to January 02 2011 
 00:00 (X01.06.2008) (time column listed as X00:00) with corresponding
 sinudoidal signal value column (X100) to give a complete curve for 24hours
 spread as curves over the whole time-span, how can I fft from this table?
 
 fft(z, inverse = FALSE) gives me as; object 'z' not found.
 
 Please help and explain how R recognises the table and does fft's from it.
 The time-series is discrete and periodic (or should be, as I need to
 analyse my Radon time-series fro exactly this and I am very stuck now).
 
 Thank you with all my heart if you can help.
 

-- 
View this message in context: 
http://www.nabble.com/Stuck-with-FFT-tp20192942p20204314.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


[R] Marginal effects in negative binomial

2008-10-28 Thread Roberto Patuelli
Dear All,

I carry out negative binomial estimations using the glm.nb command from the 
MASS package.
Is there a command or a simple procedure for computing marginal effects from a 
glm.nb fitted object?
If these are the same as for a Poisson fitted object (glm), my question remains 
how to compute them.

Thanks in advance for your help.
Roberto Patuelli



Roberto Patuelli, Ph.D.
Post-doc researcher
Institute for Economic Research (IRE)
University of Lugano (USI)
via Maderno 24, CP 4361
CH-6904 Lugano
Switzerland
Phone: +41-(0)58-666-4166
Email: [EMAIL PROTECTED]

[[alternative HTML version deleted]]

__
R-help@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.


[R] Sweave, Bibtex, package references

2008-10-28 Thread Paolo Sonego

Dear all,
I'm a big fan and happy user of the Sweave package for routine reporting.
From inside a .Rnw script, I'd like to produce the references in bibtex 
format for each package loaded in the environment, write them in a .bib 
file  and load them back from the

\bibliography{bibliography} statement.
Is this feasible?
Any help would be greatly appreciated!
Thanks in advance,
Paolo

__
R-help@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.


[R] gsubfn, strapply, REGEX Problem

2008-10-28 Thread Johannes Graumann
Hi all,

I swear this used to work:

library(gsubfn)
strapply(S(AC,P)TVDK(8)EELVQK(8), .[(].{1,2}[)]|.)[[1]]

But somewhere along the update path it stopped ... now giving me this 

Error in base::gsub(pattern, rs, x, ...) : 
  invalid backreference 2 in regular expression

Can't figure it out. What am I doing wrong?

Thanks for any hints, Joh

__
R-help@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.


[R] 2.8.0 on Mac: libR.dylib

2008-10-28 Thread Chris Lokan
I use a Macbook Pro laptop, running OX X 10.4.11. I have been running R
2.7.1 with no problems for years, including installing packages such as
chron, Cairo, Design.

Today I downloaded R 2.8.0 from my local mirror in Australia. (The md5
result matched the code on the download page.) I then used
R CMD INSTALL to install separately-downloaded versions of chron, Cairo
etc, as I have done with previous versions of R.

When I then ran R, and tried to load Cairo this is what I got:

Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared library
'/Library/Frameworks/R.framework/Versions/2.8/Resources/library/Cairo/libs/i
386/Cairo.so':
  
dlopen(/Library/Frameworks/R.framework/Versions/2.8/Resources/library/Cairo/
libs/i386/Cairo.so, 6): Library not loaded:
/Library/Frameworks/R.framework/Versions/2.7/Resources/lib/libR.dylib
  Referenced from: 
/Library/Frameworks/R.framework/Versions/2.8/Resources/library/Cairo/libs/i3
86/Cairo.so
  Reason: image not found
Error : .onLoad failed in 'loadNamespace' for 'Cairo'
Error: package/namespace load failed for 'Cairo'

It seems that missing libR.dylib is my problem.

Completely uninstalling R and then reinstalling did not resolve the problem.

I also tried a fresh download today from another mirror (BC in Canada), but
that didn't help.

I am sure I have made a dumb mistake. How do I fix things?

Chris

__
R-help@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.


Re: [R] License Question

2008-10-28 Thread Simon Blomberg
I  downloaded the trial version and during the installation it told me that I 
had to install R first (from CRAN). So it looks like the R-PLUS interface is 
separate from R. They do not distribute R with R-PLUS. I'm in no way associated 
with this company, and I don't want or need a GUI for my own work. And its a 
Windows program. So I won't be using R-PLUS.

Simon.


Simon Blomberg, BSc (Hons), PhD, MAppStat. 
Lecturer and Consultant Statistician 
Faculty of Biological and Chemical Sciences 
The University of Queensland 
St. Lucia Queensland 4072 
Australia 
T: +61 7 3365 2506 
email: S.Blomberg1_at_uq.edu.au
http://www.uq.edu.au/~uqsblomb/

Policies:
1.  I will NOT analyse your data for you.
2.  Your deadline is your problem.

The combination of some data and an aching desire for 
an answer does not ensure that a reasonable answer can 
be extracted from a given body of data. - John Tukey.



-Original Message-
From: [EMAIL PROTECTED] on behalf of Barry Rowlingson
Sent: Tue 28/10/2008 6:40 PM
To: [EMAIL PROTECTED]
Cc: r-help@r-project.org; Duncan Murdoch
Subject: Re: [R] License Question
 
2008/10/28  [EMAIL PROTECTED]:

   To answer your question, we do not distribute R.  We distribute  R-PLUS.

 But your web site claims, in big capital letters, that R-plus is THE
REAL R. If you are not distributing R (the real real R, (c) The R
Foundation), then this could be construed as false advertising.

 So I'm guessing that R-plus must be an add-on to the real real R, in
which case you can't distribute R with R-plus under a non-free
license. You can unbundle it though, and tell your users to 'first go
get R'. I can't find an installation guide or a decent FAQ that
confirms this. As a non-lawyer, I'd advise you to remove 'The Real R'
from the web site and instead put 'Works With The Real R'. And explain
this in the FAQ. And give a link to www.r-project.org.

 Oh, btw, I'd fix your blog links: go to:
http://www.experience-rplus.com/blog.asp?b=act  and click a
screenshot...

Barry

__
R-help@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.


[[alternative HTML version deleted]]

__
R-help@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.


[R] R D COM function using Excel

2008-10-28 Thread David Seres
Hello all!

I have a code in R which basically opens, saves and closes all excel sheets
in a given directory. The code is following:

- R code start
--
normal_update - function() {

# Updating files in main directory

  Dir - choose.dir()
  setwd(Dir)

  library(RDCOMClient)
  library(SWinTypeLibs)

  ex = COMCreate(Excel.Application)

  Files - list.files()[grep(.xls,list.files())]
n - length(Files)

# Choose an add in to load into excel
  add_in - file.choose()

  for(i in 1:n) {

#ex = COMCreate(Excel.Application)
  addin = ex$Workbooks()$Open(add_in)
  book = ex$Workbooks()$Open(paste(c(getwd(), /, Files[i]), collapse =
))
#shell(paste(ECHO Y | DEL, 'C:\\Dokumente und
Einstellungen\\Praktikant1\\Eigene Dateien\\RESUME.XLW'))

ex$Save()
book$Close()

rm(list = c(book, addin))

  }

}
 - R code end
--

The algorithm is:
- the first setwd sets the desired directory (in my case I need only the
above one)
- create an Excel instance
- get all the files with the ending .xls*
- start loop:
-- load the addin into excel
-- open the i-th excel file
-- save excel
-- close the excel book (not the whole excel, just the book which is open)
-- clean up the files

The problem: After the first iteration of the for-loop, when the code tries
to save and close the file I get the error message

Browse[1] i
debug: 2
...
debug: ex$Save()
Browse[1]
Fehler in .COM(x, name, ...) :
  Cannot locate 0 name(s) Save in COM object (status = -2147418111)

What is the reason for this problem and how can I bypass it?

Greetings,
David Seres

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] gsubfn, strapply, REGEX Problem

2008-10-28 Thread Gabor Grothendieck
There is no quote terminating the first argument and you
need to add the backref = 0 argument so that it does
not interpret the parentheses in the regular expression
as back references.

Its not clear to me what the intention is here so there
may be further changes needed but the ones above
result in no error message.

On Tue, Oct 28, 2008 at 7:39 AM, Johannes Graumann
[EMAIL PROTECTED] wrote:
 Hi all,

 I swear this used to work:

 library(gsubfn)
 strapply(S(AC,P)TVDK(8)EELVQK(8), .[(].{1,2}[)]|.)[[1]]

 But somewhere along the update path it stopped ... now giving me this

 Error in base::gsub(pattern, rs, x, ...) :
  invalid backreference 2 in regular expression

 Can't figure it out. What am I doing wrong?

 Thanks for any hints, Joh

 __
 R-help@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.


__
R-help@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.


Re: [R] License Question

2008-10-28 Thread Duncan Murdoch

On 10/28/2008 3:01 AM, [EMAIL PROTECTED] wrote:

   Hi Duncan,



   Yes we do follow the legal terms very carefully and make sure our general
   counsel reviews all these stuff.

   To answer your question, we do not distribute R.  We distribute  R-PLUS.


Thanks for the clarification.  As long as you're not making copies of R 
(or bits and pieces of it), the GPL doesn't place restrictions on you.


Duncan Murdoch





   When users ask us about  'R license', it usually refers to potential hidden
   costs. However you are right that explaining the GPL terms is paramount.



   Thanks -





   R-PLUS Team
24 Hours Tech Support
Think Fast, Think Big, Without The High Cost!
   [1]www.Experience-Rplus.com/Conference.asp
USAR2009, Las Vegas USA R|Rplus Conference.
April 26-30, 2009 !



    Original Message 
   Subject: Re: [R] License Question
   From: Duncan Murdoch [EMAIL PROTECTED]
   Date: Mon, October 27, 2008 6:59 pm
   To: [EMAIL PROTECTED]
   Cc: r-help@r-project.org
   [EMAIL PROTECTED] wrote:
Katrin,
   
   
   
R is completely free - no License. We've built a supported user friendly
version: R-PLUS
   
   This statement is not correct. R is licensed under the GPL. This is a
   free software license, but it is not the same as having no license.
   There are obligations under the GPL that anyone who distributes GPL'd
   software should be aware of.
   Does XL Solutions distribute R? Does it follow its obligations under
   the GPL?
   Duncan Murdoch
You can freely evaluate R-PLUS - the current free trial has no expiration
date.
   
   
   
At a click, import data from different formats, use Excel-like
spreadsheet for manipulating your data, create publication-quality
reports, generate editable graphics ... and click click to run your
favorite models through dialogs.
Check out the screenshots at [2]www.Experience-Rplus.com and tell us
what you think. Register for free trial.
   
   
   
R-PLUS Team
   
24 Hours Tech Support
   
Think Fast, Think Big, Without The High Cost!
   
[1][3]www.Experience-Rplus.com/Conference.asp
   
USAR2009, Las Vegas USA R|Rplus Conference.
   
April 26-30, 2009 !
   
   
   
--- On Mon, 10/27/08, Freiberger, Katrin [EMAIL PROTECTED]
wrote:
   
 From: Freiberger, Katrin [EMAIL PROTECTED]
 Subject: [R] License Question
 To: [EMAIL PROTECTED]
 Date: Monday, October 27, 2008, 6:04 AM
 Dear All,

 I learned about R during my studies at Cologne University
 of Applied Science. Now I work at Allianz Dresdner Bauspar
 AG and I would like to install R here too. Is there any
 license issues that need to be taken in consideration, any
 fees to pay by the company? I know there are answers to this
 in the FAQs but I didn't really understand the legal
 language. Could you therefore just give me concrete answers?

 Thanks for you help  kind regards,

 Katrin Freiberger

 __
 [EMAIL PROTECTED] mailing list
 [6][4]https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 [7][5]http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained,
 reproducible code.
   
References
   
Visible links
1. [6]http://www.experience-rplus.com/Conference.asp
2. [7]mailto:[EMAIL PROTECTED]
3. [8]mailto:[EMAIL PROTECTED]
4. [9]mailto:r-help@r-project.org
5. [10]mailto:R-help@r-project.org
6. [11]https://stat.ethz.ch/mailman/listinfo/r-help
7. [12]http://www.r-project.org/posting-guide.html
   
Hidden links:
8. [13]http://www.experience-rplus.com/Conference.asp
__
R-help@r-project.org mailing list
[14]https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
   [15]http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
   

References

   1. http://www.Experience-Rplus.com/Conference.asp
   2. http://www.Experience-Rplus.com/
   3. http://www.Experience-Rplus.com/Conference.asp
   4. https://stat.ethz.ch/mailman/listinfo/r-help
   5. http://www.R-project.org/posting-guide.html
   6. http://www.experience-rplus.com/Conference.asp
   7. http://email01.secureserver.net/pcompose.php#Compose
   8. http://email01.secureserver.net/pcompose.php#Compose
   9. http://email01.secureserver.net/pcompose.php#Compose
  10. http://email01.secureserver.net/pcompose.php#Compose
  11. https://stat.ethz.ch/mailman/listinfo/r-help
  12. http://www.r-project.org/posting-guide.html
  13. http://www.experience-rplus.com/Conference.asp
  14. https://stat.ethz.ch/mailman/listinfo/r-help
  15. http://www.R-project.org/posting-guide.html
__
R-help@r-project.org mailing list

Re: [R] Sweave, Bibtex, package references

2008-10-28 Thread ONKELINX, Thierry
Dear Paolo,

Have a look at this thread:
http://www.nabble.com/Automating-citations-in-Sweave-td20128175.html#a20
128175

HTH,

Thierry




ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium 
tel. + 32 54/436 185
[EMAIL PROTECTED] 
www.inbo.be 

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Namens Paolo Sonego
Verzonden: dinsdag 28 oktober 2008 12:41
Aan: R-List Help - use this to post
Onderwerp: [R] Sweave, Bibtex, package references

Dear all,
I'm a big fan and happy user of the Sweave package for routine
reporting.
 From inside a .Rnw script, I'd like to produce the references in bibtex

format for each package loaded in the environment, write them in a .bib 
file  and load them back from the
\bibliography{bibliography} statement.
Is this feasible?
Any help would be greatly appreciated!
Thanks in advance,
Paolo

__
R-help@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.

Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer 
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in  this message 
and any annex are purely those of the writer and may not be regarded as stating 
an official position of INBO, as long as the message is not confirmed by a duly 
signed document.

__
R-help@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.


Re: [R] 2.8.0 on Mac: libR.dylib

2008-10-28 Thread Chris Lokan
 I use a Macbook Pro laptop, running OX X 10.4.11. I have been running R
 2.7.1 with no problems for years, including installing packages such as
 chron, Cairo, Design.

Oops, I should say, I've been running R with no problems for years, most
recently version 2.7.1 ...

Even so, the change to 2.8.0 is the first time an upgrade has not been easy
for me. 

How might I fix my error?

Chris

__
R-help@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.


Re: [R] gsubfn, strapply, REGEX Problem

2008-10-28 Thread Johannes Graumann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Thanks for looking at this. The \ was an oversight for the example, but the 
backref bit solves my problem ... I wonder whether that used to be the 
default and was recently changed?

Thanks for your help!

Joh

Gabor Grothendieck wrote:

 There is no quote terminating the first argument and you
 need to add the backref = 0 argument so that it does
 not interpret the parentheses in the regular expression
 as back references.
 
 Its not clear to me what the intention is here so there
 may be further changes needed but the ones above
 result in no error message.
 
 On Tue, Oct 28, 2008 at 7:39 AM, Johannes Graumann
 [EMAIL PROTECTED] wrote:
 Hi all,

 I swear this used to work:

 library(gsubfn)
 strapply(S(AC,P)TVDK(8)EELVQK(8), .[(].{1,2}[)]|.)[[1]]

 But somewhere along the update path it stopped ... now giving me this

 Error in base::gsub(pattern, rs, x, ...) :
  invalid backreference 2 in regular expression

 Can't figure it out. What am I doing wrong?

 Thanks for any hints, Joh

 __
 R-help@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.

 
 __
 R-help@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.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)

iQIcBAEBCgAGBQJJBwZjAAoJEK3uDRxoATjEb9gP/ioWCERhZrLAaeIPMc1PSmVV
nsWojOneSNruSESMgmocrKkOYbkPVZmmBetK9gw4sw9hLErGjy1MsebHVr40pNK2
Bajm7mXJ1wbd7EDlvRfS3KpBkPvPlUmSMlp2fMoYaswcyt6Rokr3S512UlkvlLWU
QNd8NMx4iRFPn3dA84SW1SqWaKIXtpTME35k1VQw0dGvv8iTgsY6pAHWkEoezuue
g/tGY8kc2WjBpvVjSVDD4uAuzO9T502n1AjsUs+/bxVRBPIJJktFzkOJbhKQabuJ
2NfEX45B4Y/f1nMff5KQ1IS4LQUUzNwzvEuwHuw2CXfKnzopNUUjU3rcCaHwOIJz
yecnRXpGwVX+dHaLH156voiHJqpsz7tUoIUOvAQumfwmPajK9Z/KKwLoXdXQ22gB
5469gcVBI+z31euijZMRMW12M7ZidABnHd2afxrwQRZyU9sexemzVzSdAlIpIgr5
JG62rxpFY2ImmzTDncZpNik68cviB1ZLloH4twJxFk/T7DmS3x17wVofPb1yOZDq
TYCvRcGIihhZ3fZM/m2qExv+bkCS80CnY1qMY+o8BmTDcp6hH64UpCQz17o/8JG9
Fo8jjLRghuh1DBThL6zrzg+70UTqhNWXdBSLs/UPB1W8i1Xk+PTIFLWGigq1+3ty
KoHmwgt/Bd27e2XO+leu
=JlLi
-END PGP SIGNATURE-

__
R-help@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.


Re: [R] mgcv pack- gam() - question about the by argument

2008-10-28 Thread Gustaf Granath

Thanks!! The R-community is just amazing.

Two follow-up questions:

1) IF, I had sufficient amount of data. How would that interaction term 
(Site x Time) be specified? Maybe like this? (adding stuff on the 
previous example)
And I should look at the Parametric coefficients: for significant 
interaction terms, right?


#Add two more measurements
time2-data.frame(y=mydata$y*rnorm(1,mean=1,sd=0.2),x=x,Site=Site)
time3-data.frame(y=mydata$y*rnorm(1,mean=1,sd=0.2),x=x,Site=Site)
mydata.rep-rbind(mydata,time2,time3)
mydata.rep$Time-as.factor(rep(1:3,each=45))
#Model with Site x Time - correct? Or should the Time factor be 
incorporated in the 'by' argument also (if possible?)??

mod.with.sitextime-gam(y~Site*Time+s(x,by=Site,id=1),data=mydata.rep)
summary(mod.with.sitextime)

2) The Parametric coefficients estimates: are they like intercepts or 
what do they represent here (when we have factor levels involved)? Does 
a significant difference translate into different means for the factor 
levels compared?


Cheers,

Gustaf

Simon Wood wrote:

Gustaf,

Your `by' variable use looks quite correct to me. The time issue is slightly 
tricky with relatively few data. You could set up a factor variable for the 
site:time interaction (i.e. one level for each combination of site and time) 
but that would be pushing it a bit for this number of data. 


Simon

On Wednesday 22 October 2008 13:05, Gustaf Granath wrote:
  

R fellows,
I hope my questions are not too much about statistical methodology.

I do lab experiments where y is measured at different x, using
(plant)material originating from different sites (2-4). The response is
non-linear in a way that I have turned to gam() (mgcv package) to
investigate the shape of the response (maybe there are better ways). I
want to test if the shape/pattern of the response differ between sites
(i.e. should each site have its own curve). I was thinking (after I read
Wood's reference manual) to use the by= argument and fit one model
including the factor site and one without site, and then compare these
models with AIC (or can the anova.gam() be trusted here?). Is this a
correct interpretation and use of the by= argument??

I have also measured the same sample twice (weeks between) . What about
including the factor Time using the by= argument to test if the curve
differ between the two measurements (in a separate analysis looking each
site individually)? I guess this will ignore the correlation within
samples but maybe it can be used to get a rough idea?

Here is an example ( I know that sample size is low for a gam)
#Create data
y-c(0.283,0.185,0.134,0.727,0.087,0.568,0.569,0.156,0.189,0.738,0.526,0.144
,0.532,0.128,0.162,0.772,0.789,0.798,0.756,0.738,0.768,0.778,0.791,0.776,
0.808,
0.756,0.742,0.744,0.758,0.774,0.768,0.780,0.782,0.789,0.756,0.805,0.800,
0.004,0.790,0.781,0.757,0.780,0.744,0.783,0.774)
x-c(45.1,43,48.5,40,47.1,42.8,40.3,45.3,45.6,37.5,38,46.1,40.5,40.2,46.5,
27.3,24.9,27.7,24.8,26.6,25.1,23.5,26.3,26.6,27.6,
26.3,24.4,25.8,26.7,28,36,33.3,35.2,35.1,33.9,34.7,34.4,33.4,34.1,34.3,31,
33.2,33.4,35.7,32.6) Site-rep(1:3,each=5,3)
mydata-data.frame(y=y,x=x,Site=as.factor(Site))
library(mgcv)
#Model without site
mod.no.site-gam(y~s(x),data=mydata)
#Model including the factor Site. id=1 to get the same smothing
parameter at each factor level.
mod.with.site-gam(y~Site+s(x,by=Site,id=1),data=mydata)
#AIC for the two models
AIC(mod.no.site,mod.with.site)

Thanks,

Gustaf Granath (phd student)

__
R-help@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.



  


--
Gustaf Granath (PhD student)

Dept of Plant Ecology
Evolutionary Biology Centre (EBC)
Uppsala University
Villavägen 14, SE - 752 36 Uppsala, Sweden

Tel: +46 (0)18-471 76 88
Fax: 018 55 34 19
Email: [EMAIL PROTECTED]
http://www.vaxtbio.uu.se/resfold/granath.htm

__
R-help@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.


[R] How to calculate an appropiate threshold of a GPD distribution.

2008-10-28 Thread Borja Soto Varela
Dear R-users

I would like to fit the GPD distribution using the gpd function from
evir package. I need to pick an appropiate threshold. I know there are
some useful plots to assist me in this choice like meplot or mrlplot. Do you
know if there is any technique to compute or calculate an exact threshold?.

Regards
Borja

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] gsubfn, strapply, REGEX Problem

2008-10-28 Thread Gabor Grothendieck
The default has changed to be the negative of its prior
value so that would account for it.  The current
default is backref = -k where k is the number of left parens in
the regexp.  That means that it passes only the
back references (and not the match) if it thinks there
are any backreferences.  Usually this revised default
is what is wanted but the unusual aspect of this example
is that the parens don't represent back references
and the wrong default happened to work anyways.

I guess the bottom line is that if you use parens in
your regexp that are not intended to be back references
then its important to specify backref= explicitly.

The NEWS file in the gsubfn distribution does mention
the change.

On Tue, Oct 28, 2008 at 8:32 AM, Johannes Graumann
[EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA512

 Thanks for looking at this. The \ was an oversight for the example, but 
 the backref bit solves my problem ... I wonder whether that used to be the 
 default and was recently changed?

 Thanks for your help!

 Joh

 Gabor Grothendieck wrote:

 There is no quote terminating the first argument and you
 need to add the backref = 0 argument so that it does
 not interpret the parentheses in the regular expression
 as back references.

 Its not clear to me what the intention is here so there
 may be further changes needed but the ones above
 result in no error message.

 On Tue, Oct 28, 2008 at 7:39 AM, Johannes Graumann
 [EMAIL PROTECTED] wrote:
 Hi all,

 I swear this used to work:

 library(gsubfn)
 strapply(S(AC,P)TVDK(8)EELVQK(8), .[(].{1,2}[)]|.)[[1]]

 But somewhere along the update path it stopped ... now giving me this

 Error in base::gsub(pattern, rs, x, ...) :
  invalid backreference 2 in regular expression

 Can't figure it out. What am I doing wrong?

 Thanks for any hints, Joh

 __
 R-help@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.


 __
 R-help@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.
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (GNU/Linux)

 iQIcBAEBCgAGBQJJBwZjAAoJEK3uDRxoATjEb9gP/ioWCERhZrLAaeIPMc1PSmVV
 nsWojOneSNruSESMgmocrKkOYbkPVZmmBetK9gw4sw9hLErGjy1MsebHVr40pNK2
 Bajm7mXJ1wbd7EDlvRfS3KpBkPvPlUmSMlp2fMoYaswcyt6Rokr3S512UlkvlLWU
 QNd8NMx4iRFPn3dA84SW1SqWaKIXtpTME35k1VQw0dGvv8iTgsY6pAHWkEoezuue
 g/tGY8kc2WjBpvVjSVDD4uAuzO9T502n1AjsUs+/bxVRBPIJJktFzkOJbhKQabuJ
 2NfEX45B4Y/f1nMff5KQ1IS4LQUUzNwzvEuwHuw2CXfKnzopNUUjU3rcCaHwOIJz
 yecnRXpGwVX+dHaLH156voiHJqpsz7tUoIUOvAQumfwmPajK9Z/KKwLoXdXQ22gB
 5469gcVBI+z31euijZMRMW12M7ZidABnHd2afxrwQRZyU9sexemzVzSdAlIpIgr5
 JG62rxpFY2ImmzTDncZpNik68cviB1ZLloH4twJxFk/T7DmS3x17wVofPb1yOZDq
 TYCvRcGIihhZ3fZM/m2qExv+bkCS80CnY1qMY+o8BmTDcp6hH64UpCQz17o/8JG9
 Fo8jjLRghuh1DBThL6zrzg+70UTqhNWXdBSLs/UPB1W8i1Xk+PTIFLWGigq1+3ty
 KoHmwgt/Bd27e2XO+leu
 =JlLi
 -END PGP SIGNATURE-

 __
 R-help@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.


__
R-help@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.


Re: [R] gsubfn, strapply, REGEX Problem

2008-10-28 Thread Gabor Grothendieck
Have just made an improvement to the development
version to ignore escaped left parens in the regexp
in setting the backref default.  This improvement
should address your problem so that this now
works without errors:

library(gsubfn)
# overwrite relevant function with devel version of it
source(http://gsubfn.googlecode.com/svn/trunk/R/gsubfn.R;)

strapply(S(AC,P)TVDK(8)EELVQK(8), .[(].{1,2}[)]|.)[[1]]

On Tue, Oct 28, 2008 at 8:53 AM, Gabor Grothendieck
[EMAIL PROTECTED] wrote:
 The default has changed to be the negative of its prior
 value so that would account for it.  The current
 default is backref = -k where k is the number of left parens in
 the regexp.  That means that it passes only the
 back references (and not the match) if it thinks there
 are any backreferences.  Usually this revised default
 is what is wanted but the unusual aspect of this example
 is that the parens don't represent back references
 and the wrong default happened to work anyways.

 I guess the bottom line is that if you use parens in
 your regexp that are not intended to be back references
 then its important to specify backref= explicitly.

 The NEWS file in the gsubfn distribution does mention
 the change.

 On Tue, Oct 28, 2008 at 8:32 AM, Johannes Graumann
 [EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA512

 Thanks for looking at this. The \ was an oversight for the example, but 
 the backref bit solves my problem ... I wonder whether that used to be the 
 default and was recently changed?

 Thanks for your help!

 Joh

 Gabor Grothendieck wrote:

 There is no quote terminating the first argument and you
 need to add the backref = 0 argument so that it does
 not interpret the parentheses in the regular expression
 as back references.

 Its not clear to me what the intention is here so there
 may be further changes needed but the ones above
 result in no error message.

 On Tue, Oct 28, 2008 at 7:39 AM, Johannes Graumann
 [EMAIL PROTECTED] wrote:
 Hi all,

 I swear this used to work:

 library(gsubfn)
 strapply(S(AC,P)TVDK(8)EELVQK(8), .[(].{1,2}[)]|.)[[1]]

 But somewhere along the update path it stopped ... now giving me this

 Error in base::gsub(pattern, rs, x, ...) :
  invalid backreference 2 in regular expression

 Can't figure it out. What am I doing wrong?

 Thanks for any hints, Joh

 __
 R-help@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.


 __
 R-help@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.
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (GNU/Linux)

 iQIcBAEBCgAGBQJJBwZjAAoJEK3uDRxoATjEb9gP/ioWCERhZrLAaeIPMc1PSmVV
 nsWojOneSNruSESMgmocrKkOYbkPVZmmBetK9gw4sw9hLErGjy1MsebHVr40pNK2
 Bajm7mXJ1wbd7EDlvRfS3KpBkPvPlUmSMlp2fMoYaswcyt6Rokr3S512UlkvlLWU
 QNd8NMx4iRFPn3dA84SW1SqWaKIXtpTME35k1VQw0dGvv8iTgsY6pAHWkEoezuue
 g/tGY8kc2WjBpvVjSVDD4uAuzO9T502n1AjsUs+/bxVRBPIJJktFzkOJbhKQabuJ
 2NfEX45B4Y/f1nMff5KQ1IS4LQUUzNwzvEuwHuw2CXfKnzopNUUjU3rcCaHwOIJz
 yecnRXpGwVX+dHaLH156voiHJqpsz7tUoIUOvAQumfwmPajK9Z/KKwLoXdXQ22gB
 5469gcVBI+z31euijZMRMW12M7ZidABnHd2afxrwQRZyU9sexemzVzSdAlIpIgr5
 JG62rxpFY2ImmzTDncZpNik68cviB1ZLloH4twJxFk/T7DmS3x17wVofPb1yOZDq
 TYCvRcGIihhZ3fZM/m2qExv+bkCS80CnY1qMY+o8BmTDcp6hH64UpCQz17o/8JG9
 Fo8jjLRghuh1DBThL6zrzg+70UTqhNWXdBSLs/UPB1W8i1Xk+PTIFLWGigq1+3ty
 KoHmwgt/Bd27e2XO+leu
 =JlLi
 -END PGP SIGNATURE-

 __
 R-help@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.



__
R-help@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.


Re: [R] gsubfn, strapply, REGEX Problem

2008-10-28 Thread Johannes Graumann
Thank you! 

Joh

Gabor Grothendieck wrote:

 Have just made an improvement to the development
 version to ignore escaped left parens in the regexp
 in setting the backref default.  This improvement
 should address your problem so that this now
 works without errors:
 
 library(gsubfn)
 # overwrite relevant function with devel version of it
 source(http://gsubfn.googlecode.com/svn/trunk/R/gsubfn.R;)
 
 strapply(S(AC,P)TVDK(8)EELVQK(8), .[(].{1,2}[)]|.)[[1]]
 
 On Tue, Oct 28, 2008 at 8:53 AM, Gabor Grothendieck
 [EMAIL PROTECTED] wrote:
 The default has changed to be the negative of its prior
 value so that would account for it.  The current
 default is backref = -k where k is the number of left parens in
 the regexp.  That means that it passes only the
 back references (and not the match) if it thinks there
 are any backreferences.  Usually this revised default
 is what is wanted but the unusual aspect of this example
 is that the parens don't represent back references
 and the wrong default happened to work anyways.

 I guess the bottom line is that if you use parens in
 your regexp that are not intended to be back references
 then its important to specify backref= explicitly.

 The NEWS file in the gsubfn distribution does mention
 the change.

 On Tue, Oct 28, 2008 at 8:32 AM, Johannes Graumann
 [EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA512

 Thanks for looking at this. The \ was an oversight for the example,
 but the backref bit solves my problem ... I wonder whether that used
 to be the default and was recently changed?

 Thanks for your help!

 Joh

 Gabor Grothendieck wrote:

 There is no quote terminating the first argument and you
 need to add the backref = 0 argument so that it does
 not interpret the parentheses in the regular expression
 as back references.

 Its not clear to me what the intention is here so there
 may be further changes needed but the ones above
 result in no error message.

 On Tue, Oct 28, 2008 at 7:39 AM, Johannes Graumann
 [EMAIL PROTECTED] wrote:
 Hi all,

 I swear this used to work:

 library(gsubfn)
 strapply(S(AC,P)TVDK(8)EELVQK(8), .[(].{1,2}[)]|.)[[1]]

 But somewhere along the update path it stopped ... now giving me this

 Error in base::gsub(pattern, rs, x, ...) :
  invalid backreference 2 in regular expression

 Can't figure it out. What am I doing wrong?

 Thanks for any hints, Joh

 __
 R-help@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.


 __
 R-help@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.
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (GNU/Linux)

 iQIcBAEBCgAGBQJJBwZjAAoJEK3uDRxoATjEb9gP/ioWCERhZrLAaeIPMc1PSmVV
 nsWojOneSNruSESMgmocrKkOYbkPVZmmBetK9gw4sw9hLErGjy1MsebHVr40pNK2
 Bajm7mXJ1wbd7EDlvRfS3KpBkPvPlUmSMlp2fMoYaswcyt6Rokr3S512UlkvlLWU
 QNd8NMx4iRFPn3dA84SW1SqWaKIXtpTME35k1VQw0dGvv8iTgsY6pAHWkEoezuue
 g/tGY8kc2WjBpvVjSVDD4uAuzO9T502n1AjsUs+/bxVRBPIJJktFzkOJbhKQabuJ
 2NfEX45B4Y/f1nMff5KQ1IS4LQUUzNwzvEuwHuw2CXfKnzopNUUjU3rcCaHwOIJz
 yecnRXpGwVX+dHaLH156voiHJqpsz7tUoIUOvAQumfwmPajK9Z/KKwLoXdXQ22gB
 5469gcVBI+z31euijZMRMW12M7ZidABnHd2afxrwQRZyU9sexemzVzSdAlIpIgr5
 JG62rxpFY2ImmzTDncZpNik68cviB1ZLloH4twJxFk/T7DmS3x17wVofPb1yOZDq
 TYCvRcGIihhZ3fZM/m2qExv+bkCS80CnY1qMY+o8BmTDcp6hH64UpCQz17o/8JG9
 Fo8jjLRghuh1DBThL6zrzg+70UTqhNWXdBSLs/UPB1W8i1Xk+PTIFLWGigq1+3ty
 KoHmwgt/Bd27e2XO+leu
 =JlLi
 -END PGP SIGNATURE-

 __
 R-help@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.


 
 __
 R-help@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.

__
R-help@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.


[R] bug calling setRepositories in R 2.8.0

2008-10-28 Thread Kjetil Halvorsen
The following happened when calling setRepositories on R 2.8.0
compiled as a shared library on ubuntu intrepid RC:

 setRepositories(gra=TRUE)
 The program 'R' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 3063 error_code 3 request_code 15 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
[EMAIL PROTECTED]:~$

The error happened when pressing OK in the dialog window.

Kjetil

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Transferring results from R to MS Word

2008-10-28 Thread Eric Lecoutre
Tom,

Sorry to react only at tis point ; it makes months I didnt read R-help,
having unfortunalety to work for SAS.
Though I am not anymore the maintainer of the package, I am the creator of
it and may provide some insights.

- There are a lot of HTML methods, effectively hidden (namespace) ; you can
access them from example using  R2HTML:::HTML.lm
function (x, file = get(.HTML.file), digits = max(3, getOption(digits) -

3), append = TRUE, ...)
{
HTMLli(paste(Call: font class='call', deparse(x$call),
/font, sep = ), file = file, append = append, ...)
HTMLli(Coefficientsbr, file = file, append = TRUE, ...)
HTML(round(x$coeff, 3), file = file, append = TRUE, ...)
}
environment: namespace:R2HTML
You see direcly there the problem
I really may not have time myself directly though it is only 30 sec... (do
not have the necessary to compile packages on new laptop)
Fernando is in copy in case he has some time...

- Yes indeed there are such bugs in R2HTML, it was quickly and badly
programmed just to show the possibilities...

- I have somewhere some code to write directly HTML to words ; I have it for
nearly years now... Sorry for the communauty.

You may consider HTML methods to be some bricks you can build on top of it.
It's easy to write your own HTML functions and to go through clipboard for
example look at HTML2clip.

There are other places where digits are not well handled...

For lm, you may use the following:

 x=rnorm(1)
 y=rnorm(1)
 mylm=lm(y~x)
 coef(mylm)
 HTML(as.matrix(coef(mylm)),digits=10,file=file(clipboard))
Then all digits should be there.

HTH,

Eric



2008/10/28 Tom Backer Johnsen [EMAIL PROTECTED]

 Dieter Menne wrote:

 Tom Backer Johnsen backer at psych.uib.no writes:

 There are also some parts of the documentation that I do not understand.
  The list of functions includes things like HTML.lm, as far as I can see are
 invisible, both in respect to documentation and usage.


 This might be relic of a function written by my some year ago, which were
 part
 of the distribution for some time, but probably removed later.


 Hmm.  If that is true, that is not very promising.  It could indicate that
 the maintenace of the package might be patchy.

 Tom


 __
 R-help@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.htmlhttp://www.r-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Eric Lecoutre
Consultant - Business  Decision
Business Intelligence  Customer Intelligence

[[alternative HTML version deleted]]

__
R-help@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.


[R] Fixing an only one coefficient in an ARIMA model

2008-10-28 Thread Yohann MOREAU
Good afternoon,

I would like fitting an ARIMA model without the first coefficient.
For example, I want to fit an AR(3) like this : 
y[t]=a[1]*y[t-1]+a[2]*y[t-2]+a[3]*y[t-3], where a[1]=0.
How can I specify it in the function arima, if it is possible ?

Thank you in advance.
Yohann Moreau
[[alternative HTML version deleted]]

__
R-help@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.


[R] How to export text into separate text files

2008-10-28 Thread Lauri Nikkinen
Hello,

I'm producing text from my data.frame using cat function. I would like
to use for loop to export each column in my data.frame into separate
text files. Here is the example code

r - t(Indometh)
for (i in 1:ncol(r)) {
 cat(Some text,, \n)
 cat(\n)
 cat(More text, More text, More text)
 cat(\n)
 cat(paste(names(r[!is.na(r[,i]), i]), :,
as.character(r[!is.na(r[,i]), i]), \n))
 cat(---, \n)
}

So, each of these columns (results between --- and ---) should be
exported into separate text files e.g. file1.txt, file2.txt, file3.txt
etc.

Any ideas?

Thanks,
Lauri

__
R-help@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.


Re: [R] How to export text into separate text files

2008-10-28 Thread John Kane

jim holtman [EMAIL PROTECTED]  just answered a similar question for someone 
who wanted to input txt files.  His suggestion is below.  It should work for 
output as well

Jim Holtman's suggestion.
-

for (i in 2:4){
input - read.delim(paste('vegetation_', i, '.txt', sep=''))
 process the file 
}

--

--- On Tue, 10/28/08, Lauri Nikkinen [EMAIL PROTECTED] wrote:

 From: Lauri Nikkinen [EMAIL PROTECTED]
 Subject: [R] How to export text into separate text files
 To: [EMAIL PROTECTED]
 Received: Tuesday, October 28, 2008, 10:26 AM
 Hello,
 
 I'm producing text from my data.frame using cat
 function. I would like
 to use for loop to export each column in my data.frame into
 separate
 text files. Here is the example code
 
 r - t(Indometh)
 for (i in 1:ncol(r)) {
  cat(Some text,, \n)
  cat(\n)
  cat(More text, More text, More text)
  cat(\n)
  cat(paste(names(r[!is.na(r[,i]), i]), :,
 as.character(r[!is.na(r[,i]), i]), \n))
  cat(---,
 \n)
 }
 
 So, each of these columns (results between --- and ---)
 should be
 exported into separate text files e.g. file1.txt,
 file2.txt, file3.txt
 etc.
 
 Any ideas?
 
 Thanks,
 Lauri
 
 __
 R-help@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.

__
R-help@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.


Re: [R] Transferring results from R to MS Word

2008-10-28 Thread John Kane
--- On Mon, 10/27/08, Tom Backer Johnsen [EMAIL PROTECTED] wrote:

 From: Tom Backer Johnsen [EMAIL PROTECTED]
 Subject: Re: [R] Transferring results from R to MS Word
 To: Greg Snow [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED] [EMAIL PROTECTED]
 Received: Monday, October 27, 2008, 5:44 PM
 Greg Snow wrote:
  Any timing is of course your decision, but my
 observation (being one of my company's test cases for
 updating office) is that transitioning from MSWord 2003 to
 OpenOffice Writer will be less work/stress than
 transitioning from MSWord 2003 to MSWord 2007.
 
 That agrees with my own observation, I have Office 2007
 installed and 
 often have to hunt around for things.  However, I looked at
 OpenOffice 
 some time ago, and one of the impressions that remains is
 that it took a 
 long time to load.  I may be wrong about that.
 
 Tom

I believe that OpenOffice.org has been addressing this problem but it seems to 
be very idiosycratic. I have found that OOo 2.3.1 and 2.4.0 seem to load faster 
than MS Word 2007 on the same machine.  In fact I have never had any of OOo 2.x 
versions take more than roughly 5 seconds to load on a XP with 1 GB memory. 
Others report quite long loading times.

__
R-help@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.


Re: [R] Stuck with FFT

2008-10-28 Thread stephen sefick
#look at dput this is an easy way to share
#data or another great way is to make a
#fake data series
x - (c(105L, 115L, 140L, 180L, 230L, 300L, 360L, 418L, 450L, 480L,
495L, 500L, 495L, 480L, 450L, 410L, 360L, 300L, 230L, 180L, 140L,
115L, 105L, 100L, 105L, 115L, 140L, 180L, 230L, 300L, 360L, 410L,
450L, 480L, 495L, 500L, 495L, 480L, 450L, 410L, 360L, 300L, 230L,
180L, 140L, 115L, 105L, 100L))

#time series with a frequency with 24 hours making one day
y-ts(x, frequency=24, start=0)

plot(y)

#frequency domain plot of fft (spectrogram)
specturm(y)

On Tue, Oct 28, 2008 at 6:04 AM, Rthoughts
[EMAIL PROTECTED] wrote:

 EDIT: to assist you to assist me in turn, for which I am grateful, more
 detail than the below needs to be provided.

 I open tables and view them using Rcmdr so they become active datasets. I am
 assuming that x101, x100, etc, are column headings because when the dataset
 is edited they can be changed in numerical or non-numerical values. Lets
 assume I change those column headings to VB! and V2, and I would like the
 output to appear in V3. V2 contains the values to be fft'd. These are
 practise values of 24h length sinusoids thus if a sinusoid is viewed as a
 frequency value and the time-series are hourly values where periodicity, not
 amplitude, counts, this is a 24hr frequency time-series fo hourly values.

 Here's an example table (to keep it simple, there are 2 columns, V1 for the
 24h frequency values, and V2 for fft output, I don not understand the fft
 function enough yet if V1 should contain date/ time values and if V2 should
 contain the array, and V3 the output values);

 The table name, I assume, since it appears in the window border and taskbar,
 is 'Dataset'.

   V1 V2
 1 105
 2 115
 3 140
 4 180
 5 230
 6 300
 7 360
 8 418
 9 450
 10 480
 11 495
 12 500
 13 495
 14 480
 15 450
 16 410
 17 360
 18 300
 19 230
 20 180
 21 140
 22 115
 23 105
 24 100
 25 105
 26 115
 27 140
 28 180
 29 230
 30 300
 31 360
 32 410
 33 450
 34 480
 35 495
 36 500
 37 495
 38 480
 39 450
 40 410
 41 360
 42 300
 43 230
 44 180
 45 140
 46 115
 47 105
 48 100

 This is open as a table by view command. How do I go about fft'ing this?

 If I can do this I can then in turn try to analyse my real radon data which
 are hourly time-series (thus is a disctrete and periodic array). I have to
 analyse it for periodicities that can be attributed to 24hr and 24.8hr tidal
 cycles to confirm the substance of the first aim of my research.

 Secondly, how can I view the output as a graph? I am expecting a frequency
 domain from the time domain, thus a frequency of a certain amplitude should
 be produced.

 Thank you very much. I hope this clears the matter up a bit. If not, I am
 happy to provide more details.





 Rthoughts wrote:

 Dear all,

 Before I can get into serious Fourier analysis of Radon time-series I am
 practising with 24hour and 24.8hour sinusoids to assist with my
 interpretation of signals ittributed to tidal input to Radon time series.

 I am stuck. I have tried researching this to no avail. I am awating a book
 that should describe fourier transforms in detail and another one that
 should discuss the R application.

 I know what the command line is but I can't get it to refer to the array.

 What is 'z'? If I have a table open entitled '24hsinusoids' with date/
 time column by the hour from January 01 2008 00:00 to January 02 2011
 00:00 (X01.06.2008) (time column listed as X00:00) with corresponding
 sinudoidal signal value column (X100) to give a complete curve for 24hours
 spread as curves over the whole time-span, how can I fft from this table?

 fft(z, inverse = FALSE) gives me as; object 'z' not found.

 Please help and explain how R recognises the table and does fft's from it.
 The time-series is discrete and periodic (or should be, as I need to
 analyse my Radon time-series fro exactly this and I am very stuck now).

 Thank you with all my heart if you can help.


 --
 View this message in context: 
 http://www.nabble.com/Stuck-with-FFT-tp20192942p20204314.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@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.




-- 
Stephen Sefick
Research Scientist
Southeastern Natural Sciences Academy

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

-K. Mullis

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 

[R] Best way of figuring out whether graphical elements overlap?

2008-10-28 Thread Johannes Graumann
Hi all,

I'm plotting impulses, where some of them should have labels hovering above 
them. I know of plotrix' spread.labels function, but would like to save that 
for instances where there truely is to little space for the label.
Does anybody have any hints what' the most efficient way might be to achieve 
the following:
- plot an impulse plot
- before placing each of a vector of text labels, check (using strhight/width), 
whether this collides graphically with anything already plotted and only plot 
it if not.

Thanks for any hints, Joh

__
R-help@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.


[R] odbcConnectExcel2007

2008-10-28 Thread Agnolucci, Paolo
Hi

 

sorry if this is really basic but I am just starting on R.

 

Can anyone point me at how to write R objects into Excel 2007 files. I
have seen how to set up a connection to a file through
odbcConnectExcel2007(xls.file, readOnly = FALSE, ...) but it doesn't say
anything on how to write data

 

Thanks

 


_
The information contained in or attached to this email is intended only for the 
use of the individual or entity to which it is addressed. If you are not the 
intended recipient, or a person responsible for delivering it to the intended 
recipient, you are not authorised to and must not disclose, copy, distribute, 
or retain this message or any part of it. It may contain information which is 
confidential and/or covered by legal professional or other privilege (or other 
rules or laws with similar effect in jurisdictions outside England and Wales).
The views expressed in this email are not necessarily the views of Centrica 
plc, and the company, its directors, officers or employees make no 
representation or accept any liability for its accuracy or completeness unless 
expressly stated to the contrary.

Centrica plc

Registered office: Millstream, Maidenhead Road, Windsor, Berkshire SL4 5GD

Registered in England and Wales No 3033654
[[alternative HTML version deleted]]

__
R-help@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.


[R] how to easily access S-PLUS data sets in R?

2008-10-28 Thread Mark Daniel Ward

Dear R-help colleagues,

Greetings!  I'm interested in using some of the data sets from S-PLUS in 
a class that I'm teaching on R.  Our university has a license for 
S-PLUS, and I recognize that data sets from S-PLUS can be individually 
exported from S-PLUS and then imported into R.


Is there a more straightforward way to do this?  For instance, are the 
data sets from S-PLUS freely available for download (all of the data 
sets, in one batch) from some URL that I don't know about?


On the other hand, is this a legal thing to do?  We would only use the 
data for classroom use, and we do have an S-PLUS license, but I am 
uncertain about the legal issues of moving data sets from S-PLUS to R.


So, in summary, can I do it easily (for instance, download the data sets 
in S-PLUS from some URL all at once), can I do it in a more difficult 
way (for instance, one data set at a time), and is it legal to do?


Thank you for any thoughts on these issues.  I searched diligently 
through the help files, and I only found discussions about individual 
S-PLUS data sets, but nothing about moving all of the data sets from 
S-PLUS into R.


Sincerely,
Mark Daniel Ward
Department of Statistics
Purdue University
West Lafayette, IN  47907-2067

__
R-help@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.


Re: [R] ggplot2: how to combine position=stack and position=dodge in a single graph?

2008-10-28 Thread hadley wickham
On Fri, Oct 24, 2008 at 5:18 PM, Elena Schulz [EMAIL PROTECTED] wrote:
 Hi Hadley,

 thanks a lot for your quick answer.
 You should be able to replicate any dodging layout with facetting
 You mean instead of facetting by years, facetting by months? I will try this
 an see how the plot looks.

I'd do it like this:

ggplot(nc_dat, aes(CommitYear, Price, fill = newCust)) + geom_bar(stat
= identity) + facet_grid(. ~ CommitMonth) +
scale_x_discrete(labels=c(06, 07))

Although for more years, I'd think this would be better:

ggplot(nc_dat, aes(as.numeric(as.character(CommitYear)), Price, fill =
newCust)) + geom_area(position = stack) + facet_grid(. ~
CommitMonth) + scale_x_continuous(breaks = 2006:2007, labels = c(06,
07))

But generally, I'm not a big fan of stacking, because you can only
accurately see cumulative sums, not the contributions of individual
components.

 shift the second layer across a bit
 with aes(x=as.numeric(CommitMont) + 0.5)).
 I tried this, but it didn't work with my data. I think due to the fact that
 I am quite new to R.

 please send me a reproducible example.
 It took me a bit to create some reproducible example data that shows my
 problem. Please see the example script below.

Ok, so there's a couple of bugs in ggplot2 that make this not work
very well.  The best you can do is:

ggplot(nc_dat_06, aes(CommitMonth, Price, fill = newCust, width = 0.4)) +
geom_bar(aes(as.numeric(CommitMonth) - 0.20), colour=red, stat=identity) +
geom_bar(aes(as.numeric(CommitMonth) + 0.20), data=nc_dat_07,
colour=red, stat=identity) + scale_x_discrete(breaks=1:12)

(note the absence of labels on the x axis).  I'll have look into this
and see that it gets fixed for the next version.

 Wouldn't it be more intuitive to have some parameters for layers like
 stacking=c(s1, s2, ...), dodging=c(d1, d2), ..., or is the combination of
 both so rarely used?

It's rarely used, only works with bars, can be replicated closely with
facetting, and (in my opinion) is not a very effective display.

Hadley

-- 
http://had.co.nz/

__
R-help@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.


Re: [R] Transferring results from R to MS Word

2008-10-28 Thread heimdal
John Kane wrote:

 --- On Mon, 10/27/08, Tom Backer Johnsen [EMAIL PROTECTED] wrote:
 
  From: Tom Backer Johnsen [EMAIL PROTECTED]
  Subject: Re: [R] Transferring results from R to MS Word
  To: Greg Snow [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED] [EMAIL PROTECTED]
  Received: Monday, October 27, 2008, 5:44 PM
  Greg Snow wrote:
   Any timing is of course your decision, but my
  observation (being one of my company's test cases for
  updating office) is that transitioning from MSWord 2003 to
  OpenOffice Writer will be less work/stress than
  transitioning from MSWord 2003 to MSWord 2007.
  
  That agrees with my own observation, I have Office 2007
  installed and 
  often have to hunt around for things.  However, I looked at
  OpenOffice 
  some time ago, and one of the impressions that remains is
  that it took a 
  long time to load.  I may be wrong about that.
  
  Tom
 
 I believe that OpenOffice.org has been addressing this problem but it seems 
 to be very idiosycratic. I have found that OOo 2.3.1 and 2.4.0 seem to load 
 faster than MS Word 2007 on the same machine.  In fact I have never had any 
 of OOo 2.x versions take more than roughly 5 seconds to load on a XP with 1 
 GB memory. Others report quite long loading times.
 
 __
 R-help@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.


Hello,

I have found that Open Office does not accept imbedded postscript files, which 
is my output format of choice, when using R for plotting, et. al.. Grudgingly, 
I have to admit that MS Word does accept postscript files. So, when 
presentation has to be perfect, I use Latex. 

Will Open Office ever accept postscript?

John

__
R-help@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.


[R] Fitting weibull and exponential distributions to left censoring data

2008-10-28 Thread Borja Soto Varela
Dear R-users
I have some datasets, all left-censoring, and I would like to fit
distributions to (weibull,exponential, etc..). I read one solution using the
function survreg in the survival package. i.e
survreg(Surv(...)~1, dist=weibull) but it returns only the scale
parameter.

Does anyone know how to successfully fit the exponential, weibull etc...
distributions to left-censoring data?

Thanks
Borja

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Transferring results from R to MS Word

2008-10-28 Thread Marc Schwartz
on 10/28/2008 10:23 AM [EMAIL PROTECTED] wrote:
 John Kane wrote:
 
 --- On Mon, 10/27/08, Tom Backer Johnsen [EMAIL PROTECTED]
 wrote:
 
 From: Tom Backer Johnsen [EMAIL PROTECTED] Subject: Re: [R]
 Transferring results from R to MS Word To: Greg Snow
 [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]
 [EMAIL PROTECTED] Received: Monday, October 27, 2008,
 5:44 PM Greg Snow wrote:
 Any timing is of course your decision, but my
 observation (being one of my company's test cases for updating
 office) is that transitioning from MSWord 2003 to OpenOffice
 Writer will be less work/stress than transitioning from MSWord
 2003 to MSWord 2007.
 
 That agrees with my own observation, I have Office 2007 installed
 and often have to hunt around for things.  However, I looked at 
 OpenOffice some time ago, and one of the impressions that remains
 is that it took a long time to load.  I may be wrong about that.
 
 Tom
 I believe that OpenOffice.org has been addressing this problem but
 it seems to be very idiosycratic. I have found that OOo 2.3.1 and
 2.4.0 seem to load faster than MS Word 2007 on the same machine.
 In fact I have never had any of OOo 2.x versions take more than
 roughly 5 seconds to load on a XP with 1 GB memory. Others report
 quite long loading times.
 
 
 Hello,
 
 I have found that Open Office does not accept imbedded postscript
 files, which is my output format of choice, when using R for
 plotting, et. al.. Grudgingly, I have to admit that MS Word does
 accept postscript files. So, when presentation has to be perfect, I
 use Latex.
 
 Will Open Office ever accept postscript?
 
 John

OOo perfectly accepts EPS files and has done so since early on. Since
circa OOo version 2, OOo will also generate preview images.

If you are having problems getting R EPS plots into OOo, see the Details
section of ?postscript or ?setEPS in recent versions of R. This has been
covered extensively on this list. Search the archives.

That being said, I almost never do that any longer and use Sweave for
all documents, including presentations, for which I use the Beamer package.

HTH,

Marc Schwartz

__
R-help@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.


[R] group sequential analysis - stopping for futility

2008-10-28 Thread Alice . Pressman
Hello - 

I am wondering if anyone has written some R code to calculate futility 
bounds for a group sequential analysis of clinical trials data.  The 
library ldbounds has a function 'bounds'  which calculates the 
effectiveness stopping bounds for various spending functions,  but it does 
not appear to do the same for futility (sometimes called the 'inner 
wedge').

Thanks for any assistance!

-Alice

NOTICE TO RECIPIENT:  If you are not the intended recipi...{{dropped:10}}

__
R-help@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.


[R] Source code for ppr (Projection Pursuit Regression)

2008-10-28 Thread Arvind Iyer
Dear R users,

I am looking for the source code of the implementation of ppr (Projection
Pursuit Regression) in R.

It will be great if citations of the source papers on which the
implementation is based, are also provided.

Thank you,
Arvind Iyer,
Grad student, Deptt. of Biomedical Engineering
Viterbi School of Engineering
University of Southern California, Los Angeles

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Best way of figuring out whether graphical elements overlap?

2008-10-28 Thread Greg Snow
There is also the spread.labs function in the TeachingDemos package that uses a 
different method from the plotrix function and should not move any labels that 
are not overlapping.  There are also the dynIdentify and TkIdentify functions 
in the same package that allow you to interactively move labels around to where 
you are happy with their positions, then returns the coordinates to use for the 
positions in a final version of the plot.

If you want to check by hand, you can use the strheight and strwidth functions 
to find the bounding rectangles and see if they overlap (there can be some 
cases where the actual text does not overlap even if the rectangles do).

Hope this helps,

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
801.408.8111


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 project.org] On Behalf Of Johannes Graumann
 Sent: Tuesday, October 28, 2008 8:42 AM
 To: [EMAIL PROTECTED]
 Subject: [R] Best way of figuring out whether graphical elements
 overlap?

 Hi all,

 I'm plotting impulses, where some of them should have labels hovering
 above them. I know of plotrix' spread.labels function, but would like
 to save that for instances where there truely is to little space for
 the label.
 Does anybody have any hints what' the most efficient way might be to
 achieve the following:
 - plot an impulse plot
 - before placing each of a vector of text labels, check (using
 strhight/width), whether this collides graphically with anything
 already plotted and only plot it if not.

 Thanks for any hints, Joh

 __
 R-help@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.

__
R-help@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.


Re: [R] License Question

2008-10-28 Thread David Smith
[replying to r-help as well]

Hi Tom,

 Thanks.  I am looking forward to more information.

We're putting together the academic program right now, but our website
will be updated with more details in the next few weeks.  As I
mentioned though our general attitude is that RPro should be available
to individuals at academic institutions for free.  We're in the
process of finalizing some details around support and distribution.

 Good.  On the other hand, this sounds like it is (or will be) somewhat
 similar to the interfaces that already are avialble, e.g. Tinn-R or Rcmdr.
  So, what are the advantages?

We're taking a Red Hat like approach to R at REvolution. We aim to
distribute R and select packages in a form that makes it easy to
install, and we provide support and services to the institutions that
use it.  RPro includes some extensions from REvolution (such as a
cross-platform installer, some additional documentation, a package of
utilities, and we compile it to link with high-performance Intel BLAS
libraries and support parallel processing) but at it's core it's 100%
the same R you download from CRAN.  The main benefit is that we manage
the release cycle, test and verify the binaries we build, and provide
dedicated support through our technical team.  If you're more of a
bleeding edge R user happy downloading alpha versions of R and
asking questions on R-devel this probably won't be much of an
advantage for you.  But for statisticians in companies where an IT
deparment manages the installation and access to technical support is
essential we hope to provide added value, as they say (and hopefully
unburden r-help with some of the more mundane questions from
commercial R users to boot).

REvolution also aims to be a contributing member of the R community.
We're a benefactor of the R Foundation, and we contribute changes made
to the core R sources back to R.  That's required by the GPL, of
course, but it benefits everyone.  For example, we're working right
now on a 64-bit Windows build of R.  It's kinda tricky to build a
64-bit version of R on Windows right now, but once the necessary
changes are incorporated into the R sources it will be easier for
everyone, not just users of RPro.

If anyone on the list has any other questions about REvolution, please
feel free to contact me by email or phone (my number is in my
signature).  We'll also be at DSC2009 and UserR! next year.

-- 
David Smith [EMAIL PROTECTED]
Director of Community, REvolution Computing www.revolution-computing.com
Tel: +1 (206) 577-4778 x3203


On Tue, Oct 28, 2008 at 2:57 AM, Tom Backer Johnsen [EMAIL PROTECTED] wrote:
 David Smith wrote:

 Hi Tom,

 We're in the process of updating the information on our website for
 academic users, but in general we're making RPro available to academic users
 free of charge.  I'm just gathering the information from the department in
 charge of the academic program, and I'll make a public reply to r-help when
 I get that info.  Just wanted to respond to your question directly in the
 interim.

 Thanks.  I am looking forward to more information.

 RPro isn't going the route of a closed menu approach -- it's the same R
 command-line and script mode you're used to from R.  We're focussing more on
 performance, parallel computation, and additional packages.

 Good.  On the other hand, this sounds like it is (or will be) somewhat
 similar to the interfaces that already are avialble, e.g. Tinn-R or Rcmdr.
  So, what are the advantages?

 I'd be happy to answer any other questions you might have of RPro -- feel
 free to call or email.

 Thank you.

 Tom



__
R-help@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.


Re: [R] Source code for ppr (Projection Pursuit Regression)

2008-10-28 Thread Erin Hodgess
To get the references, check ?ppr

For the code:

 methods(ppr)
[1] ppr.default* ppr.formula*

   Non-visible functions are asterisked
 getAnywhere(ppr.default)
A single object matching 'ppr.default' was found
It was found in the following places
  registered S3 method for ppr from namespace stats
  namespace:stats
with value

function (x, y, weights = rep(1, n), ww = rep(1, q), nterms,
max.terms = nterms, optlevel = 2, sm.method = c(supsmu,
spline, gcvspline), bass = 0, span = 0, df = 5, gcvpen = 1,
...)
{
call - match.call()
call[[1]] - as.name(ppr)
sm.method - match.arg(sm.method)
ism - switch(sm.method, supsmu = 0, spline = 1, gcvspline = 2)
if (missing(nterms))
stop('nterms' is missing with no default)
mu - nterms
ml - max.terms
x - as.matrix(x)
y - as.matrix(y)
if (!is.numeric(x) || !is.numeric(y))
stop('ppr' applies only to numerical variables)
n - nrow(x)
if (nrow(y) != n)
stop(mismatched 'x' and 'y')
p - ncol(x)
q - ncol(y)
if (!is.null(dimnames(x)))
xnames - dimnames(x)[[2]]
else xnames - paste(X, 1:p, sep = )
if (!is.null(dimnames(y)))
ynames - dimnames(y)[[2]]
else ynames - paste(Y, 1:q, sep = )
msmod - ml * (p + q + 2 * n) + q + 7 + ml + 1
nsp - n * (q + 15) + q + 3 * p
ndp - p * (p + 1)/2 + 6 * p
.Fortran(R_setppr, as.double(span), as.double(bass), as.integer(optlevel),
as.integer(ism), as.double(df), as.double(gcvpen))
Z - .Fortran(R_smart, as.integer(ml), as.integer(mu), as.integer(p),
as.integer(q), as.integer(n), as.double(weights), as.double(t(x)),
as.double(t(y)), as.double(ww), smod = double(msmod),
as.integer(msmod), double(nsp), as.integer(nsp), double(ndp),
as.integer(ndp), edf = double(ml))
smod - Z$smod
ys - smod[q + 6]
tnames - paste(term, 1:mu)
alpha - matrix(smod[q + 6 + 1:(p * mu)], p, mu, dimnames = list(xnames,
tnames))
beta - matrix(smod[q + 6 + p * ml + 1:(q * mu)], q, mu,
dimnames = list(ynames, tnames))
fitted - drop(matrix(.Fortran(R_pppred, as.integer(nrow(x)),
as.double(x), as.double(smod), y = double(nrow(x) * q),
double(2 * smod[4]))$y, ncol = q, dimnames = dimnames(y)))
jt - q + 7 + ml * (p + q + 2 * n)
gof - smod[jt] * n * ys^2
gofn - smod[jt + 1:ml] * n * ys^2
jf - q + 6 + ml * (p + q)
smod - smod[c(1:(q + 6 + p * mu), q + 6 + p * ml + 1:(q *
mu), jf + 1:(mu * n), jf + ml * n + 1:(mu * n))]
smod[1] - mu
structure(list(call = call, mu = mu, ml = ml, p = p, q = q,
gof = gof, gofn = gofn, df = df, edf = Z$edf[1:mu], xnames = xnames,
ynames = ynames, alpha = drop(alpha), beta = ys * drop(beta),
yb = smod[5 + 1:q], ys = ys, fitted.values = fitted,
residuals = drop(y - fitted), smod = smod), class = ppr)
}
environment: namespace:stats


Hope this helps!

Sincerely,
Erin


On Tue, Oct 28, 2008 at 10:53 AM, Arvind Iyer [EMAIL PROTECTED] wrote:
 Dear R users,

 I am looking for the source code of the implementation of ppr (Projection
 Pursuit Regression) in R.

 It will be great if citations of the source papers on which the
 implementation is based, are also provided.

 Thank you,
 Arvind Iyer,
 Grad student, Deptt. of Biomedical Engineering
 Viterbi School of Engineering
 University of Southern California, Los Angeles

[[alternative HTML version deleted]]

 __
 R-help@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.




-- 
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: [EMAIL PROTECTED]

__
R-help@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.


Re: [R] How to export text into separate text files

2008-10-28 Thread Lauri Nikkinen
Thanks for the response. I have used the method Jim Holtman suggested
when exporting data.frames. In the current situation, I'm combining
text and data from data.frame, and I don't know how to separate the
results into the separate text files. I can output everything from the
loop into a single file using

output - file(temp.txt, w)
for (i in 1:ncol(r)) {
cat(Some text,, \n, file=output)
cat(\n, file=output)
cat(More text, More text, More text, file=output)
cat(\n, file=output)
cat(paste(names(r[!is.na(r[,i]), i]), :,
as.character(r[!is.na(r[,i]), i]), \n), file=output)
cat(---, \n, file=output)
}
close(output)

but then I'm stuck. I'm not sure how to edit the code from here.

Best regards,
Lauri

2008/10/28 John Kane [EMAIL PROTECTED]:

 jim holtman [EMAIL PROTECTED]  just answered a similar question for 
 someone who wanted to input txt files.  His suggestion is below.  It should 
 work for output as well

 Jim Holtman's suggestion.
 -

 for (i in 2:4){
input - read.delim(paste('vegetation_', i, '.txt', sep=''))
 process the file 
 }

 --

 --- On Tue, 10/28/08, Lauri Nikkinen [EMAIL PROTECTED] wrote:

 From: Lauri Nikkinen [EMAIL PROTECTED]
 Subject: [R] How to export text into separate text files
 To: [EMAIL PROTECTED]
 Received: Tuesday, October 28, 2008, 10:26 AM
 Hello,

 I'm producing text from my data.frame using cat
 function. I would like
 to use for loop to export each column in my data.frame into
 separate
 text files. Here is the example code

 r - t(Indometh)
 for (i in 1:ncol(r)) {
  cat(Some text,, \n)
  cat(\n)
  cat(More text, More text, More text)
  cat(\n)
  cat(paste(names(r[!is.na(r[,i]), i]), :,
 as.character(r[!is.na(r[,i]), i]), \n))
  cat(---,
 \n)
 }

 So, each of these columns (results between --- and ---)
 should be
 exported into separate text files e.g. file1.txt,
 file2.txt, file3.txt
 etc.

 Any ideas?

 Thanks,
 Lauri

 __
 R-help@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.


  __
 Connect with friends from any web browser - no download required. Try the new 
 Yahoo! Canada Messenger for the Web BETA at 
 http://ca.messenger.yahoo.com/webmessengerpromo.php


__
R-help@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.


[R] R training Courses

2008-10-28 Thread Sharon Lazenby
All,

 

There are still places available on the following courses. For more
detailed information and a registration form please contact
[EMAIL PROTECTED], or visit our website at
www.mango-solutions.com http://www.mango-solutions.com/ .

 

 

The R Language



Dates: 2nd to 3rd December. Duration: 2 days.  Location: London.







R for Pharmaceuticals

***

Dates: 27th to 29th January 2009.Duration: 3 days   Location:
New Jersey



***



The R Language

***

Dates: 27th to 28th January 2009.Duration: 2 days   Location:
London



***



R for Pharmacometrics

*

Dates: 17th to 19th February 2009.   Duration: 3 days   Location:
Copenhagen



*



Kind regards

Sharon



*   mangosolutions  
*   Tel   +44 (0)1249 767700 
*   Mob +44 (0)7966 062462  
*   Fax  +44 (0)1249 767707 

data analysis that delivers



Mango have moved - our new address is Ground Floor, Unit 2 Greenways
Business Park, Chippenham SN15 1BN




[[alternative HTML version deleted]]

__
R-help@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.


[R] Dose Profile

2008-10-28 Thread Laura Bonnett
Hi Everyone,

I have data in a long format e.g. there is one row per patient but each
follow-up appointment is included in the row.  So, a snippet of the data
looks like this:
  TrialNo Drug Sex Rand Adate1 Date1 Dose1 Time1 Adate2 Date2 Dose2
Time2  B1001029 LTG M 15719 30/04/2003 15825 150 106 29/08/2003 15946 200
227  B1117003 LTG M 15734 30/04/2003 15825 200 91 03/09/2003 15951 250 217
B138015 LTG M 14923 06/02/2001 15012 225 89 08/05/2001 15103 300 180
B112003 TPM F 14914 15/01/2001 14990 60 76 05/03/2001 15039 100 125
Of course, not everyone has the same number of follow-up appointments and so
there may be some column entries that are NAs.

What I'd like to do is a dose profile i.e. a plot of time on the x-axis
agaisnt dose on the y-axis for each patient ideally colouring lines
according to drug.  Does anyone know how I can do this?  Someone at work has
suggested that I use plot and then loess.smooth but I don't really know what
to do.

Thank you very much for your help,

Laura

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] odbcConnectExcel2007

2008-10-28 Thread Chrischizinski


Agnolucci, Paolo wrote:
 
 Hi
 
  
 
 sorry if this is really basic but I am just starting on R.
 
  
 
 Can anyone point me at how to write R objects into Excel 2007 files. I
 have seen how to set up a connection to a file through
 odbcConnectExcel2007(xls.file, readOnly = FALSE, ...) but it doesn't say
 anything on how to write data
 
  
 
 Thanks
 
 Registered in England and Wales No 3033654
   [[alternative HTML version deleted]]
 
 __
 R-help@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.
 
 

I am not sure how to write into Excel 2007 format (*.xlsx) but there is a
package that makes writing (and reading) excel files in the older format
(*.xls) fairly easy.  This package is called xlsReadWrite. 

To read an excel file in using this package:  
foo-read.xls(file=filename.xls, colNames=TRUE, rowNames=TRUE,
sheet=Sheet1, type=data.frame,checkNames=TRUE)

To write an excel file using this package:
write.xls( foo, filename.xls, colNames = TRUE)

It is fairly easy to use and Excel 2007 easily reads and write to this older
format.  

-- 
View this message in context: 
http://www.nabble.com/odbcConnectExcel2007-tp20208757p20211085.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


[R] acf() plots of a data.frame: what meaning?

2008-10-28 Thread Oliver Bandel
Hello,

what is the meaning of the plots of an acf()-plot,
when using a data frame as argument?

The result is NOT obvious for me.

There are combinations of the columns of a dataframe in the reulting
plot.
But an acf() is just defined for onyl one time-sreies.
So what do the plots mean? I did not found a description in the
help-page.


Ciao,
   Oliver

__
R-help@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.


Re: [R] License Question

2008-10-28 Thread rplus

   Thank you Simon,
   We are working on the linux version as well and will roll out more products
   during our conference in Las Vegas next year.
   Regards

   R-PLUS  Team

   24 Hours Tech Support

   Think Fast, Think Big, Without The High Cost!

   [1]www.Experience-Rplus.com/Conference.asp

   USAR2009, Las Vegas USAR|Rplus Conference.

   April 26-30, 2009 !

    Original Message 
   Subject: RE: [R] License Question
   From: Simon Blomberg [EMAIL PROTECTED]
   Date: Tue, October 28, 2008 4:45 am
   To: Barry Rowlingson [EMAIL PROTECTED],
   [EMAIL PROTECTED]
   Cc: r-help@r-project.org, Duncan Murdoch [EMAIL PROTECTED]

   I  downloaded the trial version and during the installation it told me that
   I had to install R first (from CRAN). So it looks like the R-PLUS interface
   is separate from R. They do not distribute R with R-PLUS. I'm in no way
   associated with this company, and I don't want or need a GUI for my own
   work. And its a Windows program. So I won't be using R-PLUS.
   Simon.
   Simon Blomberg, BSc (Hons), PhD, MAppStat.
   Lecturer and Consultant Statistician
   Faculty of Biological and Chemical Sciences
   The University of Queensland
   St. Lucia Queensland 4072
   Australia
   T: +61 7 3365 2506
   email: S.Blomberg1_at_uq.edu.au
   [2]http://www.uq.edu.au/~uqsblomb/
   Policies:
   1.  I will NOT analyse your data for you.
   2.  Your deadline is your problem.
   The combination of some data and an aching desire for
   an answer does not ensure that a reasonable answer can
   be extracted from a given body of data. - John Tukey.
   -Original Message-
   From: [EMAIL PROTECTED] on behalf of Barry Rowlingson
   Sent: Tue 28/10/2008 6:40 PM
   To: [EMAIL PROTECTED]
   Cc: r-help@r-project.org; Duncan Murdoch
   Subject: Re: [R] License Question
   2008/10/28  [EMAIL PROTECTED]:
  To answer your question, we do not distribute R.  We distribute  R-PLUS.
But your web site claims, in big capital letters, that R-plus is THE
   REAL R. If you are not distributing R (the real real R, (c) The R
   Foundation), then this could be construed as false advertising.
So I'm guessing that R-plus must be an add-on to the real real R, in
   which case you can't distribute R with R-plus under a non-free
   license. You can unbundle it though, and tell your users to 'first go
   get R'. I can't find an installation guide or a decent FAQ that
   confirms this. As a non-lawyer, I'd advise you to remove 'The Real R'
   from the web site and instead put 'Works With The Real R'. And explain
   this in the FAQ. And give a link to www.r-project.org.
Oh, btw, I'd fix your blog links: go to:
   [3]http://www.experience-rplus.com/blog.asp?b=act  and click a
   screenshot...
   Barry
   __
   R-help@r-project.org mailing list
   [4]https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide
   [5]http://www.R-project.org/posting-guide.html
   and provide commented, minimal, self-contained, reproducible code.

References

   1. http://www.experience-rplus.com/Conference.asp
   2. http://www.uq.edu.au/%7Euqsblomb/
   3. http://www.experience-rplus.com/blog.asp?b=act
   4. https://stat.ethz.ch/mailman/listinfo/r-help
   5. http://www.R-project.org/posting-guide.html
__
R-help@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.


[R] acf(): meaning of the blue horizontal lines

2008-10-28 Thread Oliver Bandel
Hello,

what are they meaning? It could be something that
would show a threshhold above which the result is
indicating different meanings then just random noise.
But there is no description on the definition of those lines,
so it means nothing, if it is not clearly defined.

Where can I find a detailed definiton?


Ciao,
   Oliver

__
R-help@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.


Re: [R] Sweave, Bibtex, package references

2008-10-28 Thread Paolo Sonego

Dear Thierry,

Thank you very much for you very useful advice!
I managed to solve my specific problem with this code:

echo=FALSE=
package - grep(^package:, search(), value = TRUE)
keep - sapply(package, function(x) x == package:base || 
!is.null(attr(as.environment(x), path)))

package - sub(^package:, , package[keep])
pkgDesc - lapply(package, packageDescription)
basePkgs - sapply(pkgDesc, function(x) !is.null(x$Priority)  
x$Priority == base)

otherPkgs - package[!basePkgs]
cite.by.name - function(x){
res - toBibtex(citation(x))
if (is.list(res)) res - res[[1]]
res[1] - sub({,paste({,x,sep=''),res[1],fixed=TRUE)
res
}
# suppressWarnings(cite.by.name(annotate))
tmp - sapply( otherPkgs, function(x) try( cite.by.name(x) ) )
for (i in 1:length(tmp)){
   capture.output(tmp[[i]], file= Rpackages.bib, append=T)
}
@


It does work, more or less, but still I need to write manually one by 
one  \nocite{otherPkgs[[1]]} \nocite{otherPkgs[[2]]} etc.

in order to pop up the references in the Bibliography section
\bibliographystyle{abbrv}
\bibliography{Rpackages}


Any idea how to automate this procedure?

Best Regards,
Paolo

ONKELINX, Thierry ha scritto:

Dear Paolo,

Have a look at this thread:
http://www.nabble.com/Automating-citations-in-Sweave-td20128175.html#a20
128175

HTH,

Thierry




ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium 
tel. + 32 54/436 185
[EMAIL PROTECTED] 
www.inbo.be 


To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Namens Paolo Sonego
Verzonden: dinsdag 28 oktober 2008 12:41
Aan: R-List Help - use this to post
Onderwerp: [R] Sweave, Bibtex, package references

Dear all,
I'm a big fan and happy user of the Sweave package for routine
reporting.
 From inside a .Rnw script, I'd like to produce the references in bibtex

format for each package loaded in the environment, write them in a .bib 
file  and load them back from the

\bibliography{bibliography} statement.
Is this feasible?
Any help would be greatly appreciated!
Thanks in advance,
Paolo

__
R-help@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.

Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer 
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in  this message 
and any annex are purely those of the writer and may not be regarded as stating 
an official position of INBO, as long as the message is not confirmed by a duly 
signed document.




__
R-help@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.


Re: [R] Fixing an only one coefficient in an ARIMA model

2008-10-28 Thread Kellie Wills
Hello Yohann,

Try
arima(lh, order=c(3,0,0), fixed=c(0, NA, NA, NA))

The NA entries in fixed (for AR2, AR3, and intercept) will be allowed to
vary.

Kellie Wills
Engineering Service Manager
REvolution Computing
[EMAIL PROTECTED]


On Tue, Oct 28, 2008 at 7:10 AM, Yohann MOREAU [EMAIL PROTECTED] wrote:

 Good afternoon,

 I would like fitting an ARIMA model without the first coefficient.
 For example, I want to fit an AR(3) like this :
 y[t]=a[1]*y[t-1]+a[2]*y[t-2]+a[3]*y[t-3], where a[1]=0.
 How can I specify it in the function arima, if it is possible ?

 Thank you in advance.
 Yohann Moreau
[[alternative HTML version deleted]]

 __
 R-help@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.




-- 
Kellie Wills
Engineering Service Manager
REvolution Computing
(206) 577-4778 x3206

[[alternative HTML version deleted]]

__
R-help@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.


[R] Recommended R books by XLSolutions Corporation

2008-10-28 Thread dsmith

   We've listed books we've recommended to our introductory R/R-PLUS courses
   attendees



   [1]http://www.experience-rplus.com/books.asp



   If you'd like to recommend a book, email  [EMAIL PROTECTED]



   R-PLUS  Rocks!





   R-PLUS  Team

   24 Hours Tech Support

   Think Fast, Think Big, Without The High Cost!

   [3]www.Experience-Rplus.com/Conference.asp

   USAR2009, Las Vegas USAR|Rplus Conference.

   April 26-30, 2009 !

References

   Visible links
   1. http://www.experience-rplus.com/books.asp
   2. mailto:[EMAIL PROTECTED]
   3. http://www.experience-rplus.com/Conference.asp

   Hidden links:
   4. http://www.experience-rplus.com/Conference.asp
   5. http://www.experience-rplus.com/Conference.asp
__
R-help@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.


[R] Random Forest Bug

2008-10-28 Thread Roeder Jens (CR/AEM5)
Dear help list,

I think I found a bug a the R Random Forest. Hopefully, you are able to
reproduce it.
I use R version 2.7.2 and RF version 4.5-27.
This is a minimal code to describe the problem:

library(randomForest)
tries - 20
dimension - 20
n - 200
outlyingness - rep(NaN,tries)
for (o_number in 1:tries){
features - matrix(rnorm(n*dimension,0,1),n,dimension)
#Generate features, n uncorrelated normally distributed points
outlier.rf - randomForest(features, ntree=100, proximity=TRUE)
#Compute Random Forest including the proximity matrix
outlyingness_all - apply(outlier.rf$proximity,2,mean) #Compute
the mean proximity for each of the n points
better - sum(outlyingness_all[1]outlyingness_all) #Compute
the rank of a certain point according to the outlyingness
outlyingness[o_number] - 1+better
}
outlyingness


Point number 1 plays a special role in this code fragment.
A typical value for outlyingness is 
200 200 200 200 196 200 200 200 200 200 200 200 200 200 200 200 199 200
200 200
whereas one obtains what one would expect for any other point. So, if 
better - sum(outlyingness_all[1]outlyingness_all) 
is for example replaced by
better - sum(outlyingness_all[17]outlyingness_all) 
one gets
194   7 184  76  25  40 175 174 137  75  49 146 175 150 148 118 100  88
121 14

Is this a bug or am I confused?
Can anybody help me? Does anybody know the problem? 

Best regards

Jens Roeder




[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Marginal effects in negative binomial

2008-10-28 Thread John Fox
Dear Roberto,

It depends on what you mean by marginal effects, but the effects package
will calculate what I would prefer to call partial effects for terms in a
generalized linear model; it should work fine with objects produced by
glm.nb.

I hope this helps,
 John

--
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
web: socserv.mcmaster.ca/jfox


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On
 Behalf Of Roberto Patuelli
 Sent: October-28-08 7:25 AM
 To: r-help@r-project.org
 Subject: [R] Marginal effects in negative binomial
 
 Dear All,
 
 I carry out negative binomial estimations using the glm.nb command from
the
 MASS package.
 Is there a command or a simple procedure for computing marginal effects
from
 a glm.nb fitted object?
 If these are the same as for a Poisson fitted object (glm), my question
 remains how to compute them.
 
 Thanks in advance for your help.
 Roberto Patuelli
 
 
 
 Roberto Patuelli, Ph.D.
 Post-doc researcher
 Institute for Economic Research (IRE)
 University of Lugano (USI)
 via Maderno 24, CP 4361
 CH-6904 Lugano
 Switzerland
 Phone: +41-(0)58-666-4166
 Email: [EMAIL PROTECTED]
 
   [[alternative HTML version deleted]]
 
 __
 R-help@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.

__
R-help@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.


[R] Sweave Error

2008-10-28 Thread [EMAIL PROTECTED]

dear R users,

I am using sweave to generate report for my data analysis.
I recently updated R ro 2.8.0, and now I have the following results when 
compile the the tex file generated from R. 

This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
 %-line parsing enabled.
entering extended mode
(./Lajos.tex
LaTeX2e 2005/12/01
Babel v3.8h and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, croatian, ukrainian, russian, bulgarian, czech, slovak, danish, dut
ch, finnish, basque, french, german, ngerman, ibycus, greek, monogreek, ancient
greek, hungarian, italian, latin, mongolian, norsk, icelandic, interlingua, tur
kish, coptic, romanian, welsh, serbian, slovenian, estonian, esperanto, upperso
rbian, indonesian, polish, portuguese, spanish, catalan, galician, swedish, loa
ded.
(/usr/share/texmf-texlive/tex/latex/base/report.cls
Document Class: report 2005/09/16 v1.4f Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo))
(/usr/share/texmf-texlive/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/share/texmf-texlive/tex/latex/amsmath/amstext.sty
(/usr/share/texmf-texlive/tex/latex/amsmath/amsgen.sty))
(/usr/share/texmf-texlive/tex/latex/amsmath/amsbsy.sty)
(/usr/share/texmf-texlive/tex/latex/amsmath/amsopn.sty))

! LaTeX Error: File `Sweave.sty' not found.

Type X to quit or RETURN to proceed,
or enter new name. (Default extension: sty)

who to solve the problem?

--
claudio

__
R-help@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.


[R] abind

2008-10-28 Thread Suyan Tian
I am trying to combine two arrays with different dimensions into one.  
For example


The first one is
1  2  3
4  5  6

The second one is
7 8
9 10

The resulted one would be like
, , 1
1 2 3
4 5 6
, , 2
7 8
9 10

I used abind to do this, but failed. Could somebody please let me  
know how to do this in R? Thanks so many.



Suyan

__
R-help@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.


Re: [R] abind

2008-10-28 Thread Henrique Dallazuanna
You can use lists for this:

list(a, b)

On Tue, Oct 28, 2008 at 3:39 PM, Suyan Tian [EMAIL PROTECTED]wrote:

 I am trying to combine two arrays with different dimensions into one. For
 example

 The first one is
 1  2  3
 4  5  6

 The second one is
 7 8
 9 10

 The resulted one would be like
 , , 1
 1 2 3
 4 5 6
 , , 2
 7 8
 9 10

 I used abind to do this, but failed. Could somebody please let me know how
 to do this in R? Thanks so many.


 Suyan

 __
 R-help@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.




-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40 S 49° 16' 22 O

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Recommended R books by XLSolutions Corporation

2008-10-28 Thread Bert Gunter
David:

IMHO, this is beginning to be commercial abuse of this list. Please no more
advertising.

(Others may have different opinions).

-- Bert 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, October 28, 2008 9:33 AM
To: r-help@r-project.org
Subject: [R] Recommended R books by XLSolutions Corporation


   We've listed books we've recommended to our introductory R/R-PLUS courses
   attendees



   [1]http://www.experience-rplus.com/books.asp



   If you'd like to recommend a book, email  [EMAIL PROTECTED]



   R-PLUS  Rocks!





   R-PLUS  Team

   24 Hours Tech Support

   Think Fast, Think Big, Without The High Cost!

   [3]www.Experience-Rplus.com/Conference.asp

   USAR2009, Las Vegas USAR|Rplus Conference.

   April 26-30, 2009 !

References

   Visible links
   1. http://www.experience-rplus.com/books.asp
   2. mailto:[EMAIL PROTECTED]
   3. http://www.experience-rplus.com/Conference.asp

   Hidden links:
   4. http://www.experience-rplus.com/Conference.asp
   5. http://www.experience-rplus.com/Conference.asp
__
R-help@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.

__
R-help@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.


Re: [R] Pkg rgl: installation fails because of x11

2008-10-28 Thread megha patnaik
This works. After installing the dependencies and installing RGL from inside
R,

library(rgl)
rgl.open()

should open a display window for you.


2008/10/27 Ben Bolker [EMAIL PROTECTED]

 Duncan Murdoch murdoch at stats.uwo.ca writes:

 
  Matthieu Stigler wrote:
   Hello
  
   Im trying to install package rgl in a freshly installed Ubuntu 8.04
   system. I have a problem (actually is has been reported three times on
   the R-list but the answers were too complicated for me) when
   installing:


   I believe the correct incantation is:

 sudo apt-get build-dep r-cran-rgl

  If that doesn't work, get back to us

  Ben Bolker

 __
 R-help@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.


[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Dose Profile

2008-10-28 Thread Bert Gunter
Why don't you ask your someone at work to help, as you appear to have
local resources handy?

-- Bert Gunter 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Laura Bonnett
Sent: Tuesday, October 28, 2008 9:33 AM
To: r-help@r-project.org
Subject: [R] Dose Profile

Hi Everyone,

I have data in a long format e.g. there is one row per patient but each
follow-up appointment is included in the row.  So, a snippet of the data
looks like this:
  TrialNo Drug Sex Rand Adate1 Date1 Dose1 Time1 Adate2 Date2 Dose2
Time2  B1001029 LTG M 15719 30/04/2003 15825 150 106 29/08/2003 15946 200
227  B1117003 LTG M 15734 30/04/2003 15825 200 91 03/09/2003 15951 250 217
B138015 LTG M 14923 06/02/2001 15012 225 89 08/05/2001 15103 300 180
B112003 TPM F 14914 15/01/2001 14990 60 76 05/03/2001 15039 100 125
Of course, not everyone has the same number of follow-up appointments and so
there may be some column entries that are NAs.

What I'd like to do is a dose profile i.e. a plot of time on the x-axis
agaisnt dose on the y-axis for each patient ideally colouring lines
according to drug.  Does anyone know how I can do this?  Someone at work has
suggested that I use plot and then loess.smooth but I don't really know what
to do.

Thank you very much for your help,

Laura

[[alternative HTML version deleted]]

__
R-help@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.

__
R-help@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.


Re: [R] abind

2008-10-28 Thread Tony Plate

It looks like you are trying to construct a ragged array, where the extent of 
the dimensions varies.

However, in R, ordinary arrays have a regular structure, e.g., the rows of a 
matrix always have the same number of columns.  This is the kind of object 
abind() constructs.

So, to bind your two matrices together, abind() requires that their dimensions 
match


a - matrix(1:6, ncol=3, byrow=T)
b - matrix(7:10, ncol=2, byrow=T)
a

[,1] [,2] [,3]
[1,]123
[2,]456

b

[,1] [,2]
[1,]78
[2,]9   10

library(abind)
abind(a, b, along=3)
Error in abind(a, b, along = 3) : 
 arg 'X2' has dims=2, 2, 1; but need dims=2, 3, X


The only way to get abind to bind these together on the third dimension is to 
pad out the smaller matrix with NA's, e.g.:


abind(a, cbind(b, NA), along=3)

, , 1

[,1] [,2] [,3]
[1,]123
[2,]456

, , 2

[,1] [,2] [,3]
[1,]78   NA
[2,]9   10   NA





('a' and 'b' do match on the number of rows, so you can bind them together as 
columns as does cbind(), e.g.:

abind(a, b, along=2)

[,1] [,2] [,3] [,4] [,5]
[1,]12378
[2,]4569   10



)


If none of this is what you want, you could consider storing the matrices in a 
list, as another poster suggested.

-- Tony Plate


Suyan Tian wrote:
I am trying to combine two arrays with different dimensions into one. 
For example


The first one is
1  2  3
4  5  6

The second one is
7 8
9 10

The resulted one would be like
, , 1
1 2 3
4 5 6
, , 2
7 8
9 10

I used abind to do this, but failed. Could somebody please let me know 
how to do this in R? Thanks so many.



Suyan

__
R-help@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.



__
R-help@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.


Re: [R] Sweave Error

2008-10-28 Thread Martin Morgan

[EMAIL PROTECTED] wrote:

dear R users,

I am using sweave to generate report for my data analysis.
I recently updated R ro 2.8.0, and now I have the following results when compile the the tex file generated from R. 


Hi Claudio

How do you invoke latex? On many systems, this works

% R CMD pdflatex Lajos.tex

The R CMD sets up the environment so that Sweave.sty can be found. If 
this fails, the next step is to figure out where texlive searches for 
.sty files (typically an environment variable) and configure it so that 
it finds R_HOME/share/texmf/Sweave.sty. The final resort is to copy 
R_HOME/share/texmf/Sweave.sty into the same directory as Lajos.tex.


Martin


This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
 %-line parsing enabled.
entering extended mode
(./Lajos.tex
LaTeX2e 2005/12/01
Babel v3.8h and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, croatian, ukrainian, russian, bulgarian, czech, slovak, danish, dut
ch, finnish, basque, french, german, ngerman, ibycus, greek, monogreek, ancient
greek, hungarian, italian, latin, mongolian, norsk, icelandic, interlingua, tur
kish, coptic, romanian, welsh, serbian, slovenian, estonian, esperanto, upperso
rbian, indonesian, polish, portuguese, spanish, catalan, galician, swedish, loa
ded.
(/usr/share/texmf-texlive/tex/latex/base/report.cls
Document Class: report 2005/09/16 v1.4f Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo))
(/usr/share/texmf-texlive/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/share/texmf-texlive/tex/latex/amsmath/amstext.sty
(/usr/share/texmf-texlive/tex/latex/amsmath/amsgen.sty))
(/usr/share/texmf-texlive/tex/latex/amsmath/amsbsy.sty)
(/usr/share/texmf-texlive/tex/latex/amsmath/amsopn.sty))

! LaTeX Error: File `Sweave.sty' not found.

Type X to quit or RETURN to proceed,
or enter new name. (Default extension: sty)

who to solve the problem?

--
claudio

__
R-help@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.



--
Martin Morgan
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M2 B169
Phone: (206) 667-2793

__
R-help@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.


Re: [R] Recommended R books by XLSolutions Corporation

2008-10-28 Thread Steve_Friedman
I agree with Bert,

The R user group lists should not be a vehicle for private commercial
vendors.

Steve Friedman Ph. D.
Spatial Statistical Analyst
Everglades and Dry Tortugas National Park
950 N Krome Ave (3rd Floor)
Homestead, Florida 33034

Office (305) 224 - 4282
[EMAIL PROTECTED]


   
 Bert Gunter   
 [EMAIL PROTECTED] 
 ne.comTo 
 Sent by:  [EMAIL PROTECTED],  
 [EMAIL PROTECTED] r-help@r-project.org  
 project.orgcc 
   
   Subject 
 10/28/2008 10:47  Re: [R] Recommended R books by  
 AM MSTXLSolutions Corporation 
   
   
   
   
   
   




David:

IMHO, this is beginning to be commercial abuse of this list. Please no more
advertising.

(Others may have different opinions).

-- Bert

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, October 28, 2008 9:33 AM
To: r-help@r-project.org
Subject: [R] Recommended R books by XLSolutions Corporation


   We've listed books we've recommended to our introductory R/R-PLUS
courses
   attendees



   [1]http://www.experience-rplus.com/books.asp



   If you'd like to recommend a book, email  [EMAIL PROTECTED]



   R-PLUS  Rocks!





   R-PLUS  Team

   24 Hours Tech Support

   Think Fast, Think Big, Without The High Cost!

   [3]www.Experience-Rplus.com/Conference.asp

   USAR2009, Las Vegas USAR|Rplus Conference.

   April 26-30, 2009 !

References

   Visible links
   1. http://www.experience-rplus.com/books.asp
   2. mailto:[EMAIL PROTECTED]
   3. http://www.experience-rplus.com/Conference.asp

   Hidden links:
   4. http://www.experience-rplus.com/Conference.asp
   5. http://www.experience-rplus.com/Conference.asp
__
R-help@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.

__
R-help@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.

__
R-help@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.


Re: [R] Recommended R books by XLSolutions Corporation

2008-10-28 Thread Bert Gunter
David et. al:
 
My sentiments are the same, but my apology to you (and I'm glad to learn
that it's not you!).
 
-- Bert
 

  _  

From: David Smith [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 28, 2008 11:09 AM
To: Bert Gunter
Subject: Re: [R] Recommended R books by XLSolutions Corporation


Hi Bert, 

I believe [EMAIL PROTECTED]'s name is actually Drew, not David.  In any
case, it's not me (the David Smith formerly of MathSoft/Insightful).

Per: https://stat.ethz.ch/pipermail/r-help/2006-August/110734.html

Personally, I find it a little confusing or perhaps disingenuous that they
just use dsmith without providing their actual name.

Cheers,
# David

On Tue, Oct 28, 2008 at 10:47 AM, Bert Gunter [EMAIL PROTECTED]
wrote:


David:

IMHO, this is beginning to be commercial abuse of this list. Please no more
advertising.

(Others may have different opinions).

-- Bert


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, October 28, 2008 9:33 AM
To: r-help@r-project.org
Subject: [R] Recommended R books by XLSolutions Corporation


  We've listed books we've recommended to our introductory R/R-PLUS courses
  attendees



  [1]http://www.experience-rplus.com/books.asp



  If you'd like to recommend a book, email  [EMAIL PROTECTED]



  R-PLUS  Rocks!





  R-PLUS  Team

  24 Hours Tech Support

  Think Fast, Think Big, Without The High Cost!

  [3]www.Experience-Rplus.com/Conference.asp

  USAR2009, Las Vegas USAR|Rplus Conference.

  April 26-30, 2009 !

References

  Visible links
  1. http://www.experience-rplus.com/books.asp
  2. mailto:[EMAIL PROTECTED]
  3. http://www.experience-rplus.com/Conference.asp

  Hidden links:
  4. http://www.experience-rplus.com/Conference.asp
  5. http://www.experience-rplus.com/Conference.asp
__
R-help@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.

__
R-help@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.





-- 
David Smith [EMAIL PROTECTED]
Director of Community, REvolution Computing www.revolution-computing.com
Tel: +1 (206) 577-4778 x3203 (Seattle, USA)


[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] License Question

2008-10-28 Thread James MacDonald
 Barry Rowlingson [EMAIL PROTECTED] wrote:
  Oh, btw, I'd fix your blog links: go to:
 http://www.experience-rplus.com/blog.asp?b=act  and click a
 screenshot...

Now that is hilarious. A fine example of defensive coding for the web circa 
2008 ;-D

Best,

Jim


 
 Barry
 
 __
 R-help@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.
-- 

James W. MacDonald, M.S.
Biostatistician
Hildebrandt Lab
8220D MSRB III
1150 W. Medical Center Drive
Ann Arbor MI 48109-5646
734-936-8662


**
Electronic Mail is not secure, may not be read every day, and should not be 
used for urgent or sensitive issues

__
R-help@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.


[R] color individual bar of histogram?

2008-10-28 Thread Whit Armstrong
Anyone know a quick way to color one bar of a histogram?

I want to mark the bar in which the most recent observation falls.

So, for instance:

x - rnorm(100)
latest.ob - x[100]
hist(x)
## how do I mark the bucket that latest.ob falls into?


Thanks,
Whit

__
R-help@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.


[R] change data into array

2008-10-28 Thread Suyan Tian
Sorry to bother everyone again with one question about array.  I have  
one data set saved in this way


patienttime x1  x2  response
1   1 18 1
1   2 27 1
2   1 36 1
2   2 45 1
3   1 5   4  2
3   2 6   3  2
4   172  2
4   281  2

I am wondering if there is any easy way to change the data into an  
array that 1st dimension is for variables (x1 and x2),  2nd is for  
patients (I would like to call it replicates), 3rd is for time  (2  
and 1), 4th is for response (2 and 1). The resulted array would look  
like as follows:


, , 1, 1

 [,1] [,2]
[1,]13
[2,]8   6

, , 2, 1

 [,1] [,2]
[1,]2   4
[2,]7   5

, , 1, 2

 [,1] [,2]
[1,]5  7
[2,]   4   2

, , 2, 2

 [,1] [,2]
[1,]   6   8
[2,]   3   1


Thanks a lot,

Suyan

__
R-help@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.


Re: [R] Computational problems in R

2008-10-28 Thread Steven McKinney

I misinterpreted the suggestion from Duncan
Murdoch, and I think Amy did too, judging
from her comment about B possibly being negative.

Duncan Murdoch kindly explained the idea
off-list, many thanks to him for taking the time.
To avoid further confusion, I've set up a basic
example explaining the suggestion.

Suppose this is the sum 
sum(exp(c_i/d)) i = 1, ..., n
that needs evaluating:

exp(-71) + exp(12) + exp(842) + exp(2100) + exp(141) + exp(-710)

The maximum term in the sum is exp(2100) 
so in the notation of the identity
A+B = A*(1 + B/A) = exp(log(A) + log(1 + B/A))

A = exp(2100)
B = exp(-71) + exp(12) + exp(842) + exp(141) + exp(-710)

so sum(exp(c_i/d)) i = 1, ..., n is
exp(2100) * ( 1 + ((exp(-71) + exp(12) + exp(842) + exp(141) + 
exp(-710))/exp(2100)) )
= exp(2100) * ( 1 + exp(-71 - 2100) + exp(12 - 2100) + exp(842 - 2100) + 
exp(141 - 2100) + exp(-710 - 2100) )

and of course all the terms 
exp(-71 - 2100) 
exp(12 - 2100) 
exp(842 - 2100) 
exp(141 - 2100) 
exp(-710 - 2100)
are very close to zero, so the sum
sum(exp(c_i/d)) i = 1, ..., n is 
exp(2100)
or 2100 on the log scale.

The terms in B are of course never negative as they
are all exponential quantities greater than zero,
so that's not an issue in this calculation (this
'B' not being the same as the 'B' in Amy's original
description).

Thanks again to Duncan Murdoch, and my apologies
for my misinterpretation.


Steven McKinney


-Original Message-
From: Robin Hankin [mailto:[EMAIL PROTECTED]
Sent: Tue 10/28/2008 12:58 AM
To: A.Noufaily
Cc: Duncan Murdoch; r-help@r-project.org; [EMAIL PROTECTED]; Steven McKinney; 
Xiaoxu LI
Subject: Re: [R] Computational problems in R
 
Hello.

The Brobdingnag package uses that identity for a logarithmic
representation and also has a hack for negative numbers.


HTH

rksh



A.Noufaily wrote:
  
 Many thanks for your suggestions...

 I am still checking which one is the most useful for my simulations.

 Concerning using logs, this might be very helpful, but I am not sure if
 I can use the following:
 A+B = A*(1 + B/A)
 = exp(log(A) + log(1 + B/A))
 because unfortunately B can be negative.
 However, I might still use logs in case (1 + B/A)0.

 Regards,
  
 Amy

 -Original Message-
 From: Duncan Murdoch [mailto:[EMAIL PROTECTED] 
 Sent: Saturday, October 25, 2008 11:36 AM
 To: Steven McKinney
 Cc: A.Noufaily; r-help@r-project.org
 Subject: Re: [R] Computational problems in R

 On 24/10/2008 9:50 PM, Steven McKinney wrote:
   
 I suspect there's a deeper issue here.
 sum(exp(yi)) when large yi occur is
 problematic.  exp(yi) for yi710 is
 just a huge number, and summing additional values only makes the 
 overall sum larger as all components of the summation are positive.
 There's no way around that.
 

 Sure there is, and you quoted it below.  Work on a log scale.  The log
 of exp(yi) is yi, and it sounds as though the yi values are manageable.

 You might end up knowing that the log of the final answer is 2 and
 not be able to evaluate exp(2) in R, but you still know that the
 answer is exp(2).

 Duncan Murdoch
   
 You could try this with Robin Hankins'
 package brobdingnag which can handle bunches of bizarrely large 
 numbers.

 What kind of process are you studying?
 What kind of process generates values
 such as exp(8/0.01) when other values
 are much smaller?  Are these outliers
 in an otherwise well-behaved
 data set?  Perhaps then they need
 to be set aside and investigated
 separately, etc.


 Steven McKinney

 Statistician
 Molecular Oncology and Breast Cancer Program British Columbia Cancer 
 Research Centre

 email: smckinney +at+ bccrc +dot+ ca

 tel: 604-675-8000 x7561

 BCCRC
 Molecular Oncology
 675 West 10th Ave, Floor 4
 Vancouver B.C. 
 V5Z 1L3
 Canada




 -Original Message-
 From: [EMAIL PROTECTED] on behalf of Duncan Murdoch
 Sent: Fri 10/24/2008 4:04 PM
 To: A.Noufaily
 Cc: r-help@r-project.org
 Subject: Re: [R] Computational problems in R
  
 On 24/10/2008 12:42 PM, A.Noufaily wrote:
 
 Dear all,

 I would be grateful if anyone can help me with the following:

 My aim is to compute explicitely the sum S=A+B where 
 A=sum(exp(c_i/d)), i=1,...,n; B, c_i, and d are real numbers with 
 -InfB,c_i+Inf; and d0.
 The problem is that when c_i/d 710 (for some i) R is setting
 exp(c_i/d) to be equal to +Inf and hence the whole summation S.
 So in simple cases where for example c_i=8 (for some i), and d=0.01 
 the whole summation is turning out to be infinite.
 Is there a way to get round that in R?
 Can anyone suggest any computational trick to calculate S when 
 c_i/d710 (for some i)?
   
 Work on a log scale.  Use the identity that

 A+B = A*(1 + B/A)
  = exp(log(A) + log(1 + B/A))

 (where you chose A to be the biggest term in the sum).

 Duncan Murdoch

 
 Any suggestions would be much appreciated.

 Regards,

 Amy





 -
 The Open University is incorporated by Royal Charter (RC 000391), an
   

Re: [R] Recommended R books by XLSolutions Corporation

2008-10-28 Thread eugene dalt
 I attended a course at XLSolutions and glad they can publish a list of 
recommended R books. 

IMHO they shouldn't  post it here though.

This name issue is hilarious given thousands of David Smith out there but to 
cut the story short, my class at XLSolutions was taught by a David Andrew Smith 
who prefers to be called Drew because there are 2 David smith in his department.

My 2 cents !


--- On Tue, 10/28/08, Bert Gunter [EMAIL PROTECTED] wrote:

 From: Bert Gunter [EMAIL PROTECTED]
 Subject: Re: [R] Recommended R books by XLSolutions Corporation
 To: 'David Smith' [EMAIL PROTECTED]
 Cc: r-help@r-project.org
 Date: Tuesday, October 28, 2008, 11:23 AM
 David et. al:
  
 My sentiments are the same, but my apology to you (and
 I'm glad to learn
 that it's not you!).
  
 -- Bert
  
 
   _  
 
 From: David Smith [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, October 28, 2008 11:09 AM
 To: Bert Gunter
 Subject: Re: [R] Recommended R books by XLSolutions
 Corporation
 
 
 Hi Bert, 
 
 I believe [EMAIL PROTECTED]'s name is actually
 Drew, not David.  In any
 case, it's not me (the David Smith formerly of
 MathSoft/Insightful).
 
 Per:
 https://stat.ethz.ch/pipermail/r-help/2006-August/110734.html
 
 Personally, I find it a little confusing or perhaps
 disingenuous that they
 just use dsmith without providing their actual
 name.
 
 Cheers,
 # David
 
 On Tue, Oct 28, 2008 at 10:47 AM, Bert Gunter
 [EMAIL PROTECTED]
 wrote:
 
 
 David:
 
 IMHO, this is beginning to be commercial abuse of this
 list. Please no more
 advertising.
 
 (Others may have different opinions).
 
 -- Bert
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On
 Behalf Of [EMAIL PROTECTED]
 Sent: Tuesday, October 28, 2008 9:33 AM
 To: r-help@r-project.org
 Subject: [R] Recommended R books by XLSolutions Corporation
 
 
   We've listed books we've recommended to our
 introductory R/R-PLUS courses
   attendees
 
 
 
   [1]http://www.experience-rplus.com/books.asp
 
 
 
   If you'd like to recommend a book, email 
 [EMAIL PROTECTED]
 
 
 
   R-PLUS  Rocks!
 
 
 
 
 
   R-PLUS  Team
 
   24 Hours Tech Support
 
   Think Fast, Think Big, Without The High Cost!
 
   [3]www.Experience-Rplus.com/Conference.asp
 
   USAR2009, Las Vegas USAR|Rplus Conference.
 
   April 26-30, 2009 !
 
 References
 
   Visible links
   1. http://www.experience-rplus.com/books.asp
   2. mailto:[EMAIL PROTECTED]
   3. http://www.experience-rplus.com/Conference.asp
 
   Hidden links:
   4. http://www.experience-rplus.com/Conference.asp
   5. http://www.experience-rplus.com/Conference.asp
 __
 R-help@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.
 
 __
 R-help@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.
 
 
 
 
 
 -- 
 David Smith [EMAIL PROTECTED]
 Director of Community, REvolution Computing
 www.revolution-computing.com
 Tel: +1 (206) 577-4778 x3203 (Seattle, USA)
 
 
   [[alternative HTML version deleted]]
 
 __
 R-help@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.

__
R-help@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.


Re: [R] Recommended R books by XLSolutions Corporation

2008-10-28 Thread eugene dalt
 I attended a course at XLSolutions and glad they can publish a list of 
recommended R books. 

IMHO they shouldn't  post it here though.

This name issue is hilarious given thousands of David Smith out there but to 
cut the story short, my class at XLSolutions was taught by a David Andrew Smith 
who prefers to be called Drew because there are 2 David smith in his department.

My 2 cents !


--- On Tue, 10/28/08, Bert Gunter [EMAIL PROTECTED] wrote:

 From: Bert Gunter [EMAIL PROTECTED]
 Subject: Re: [R] Recommended R books by XLSolutions Corporation
 To: 'David Smith' [EMAIL PROTECTED]
 Cc: r-help@r-project.org
 Date: Tuesday, October 28, 2008, 11:23 AM
 David et. al:
  
 My sentiments are the same, but my apology to you (and
 I'm glad to learn
 that it's not you!).
  
 -- Bert
  
 
   _  
 
 From: David Smith [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, October 28, 2008 11:09 AM
 To: Bert Gunter
 Subject: Re: [R] Recommended R books by XLSolutions
 Corporation
 
 
 Hi Bert, 
 
 I believe [EMAIL PROTECTED]'s name is actually
 Drew, not David.  In any
 case, it's not me (the David Smith formerly of
 MathSoft/Insightful).
 
 Per:
 https://stat.ethz.ch/pipermail/r-help/2006-August/110734.html
 
 Personally, I find it a little confusing or perhaps
 disingenuous that they
 just use dsmith without providing their actual
 name.
 
 Cheers,
 # David
 
 On Tue, Oct 28, 2008 at 10:47 AM, Bert Gunter
 [EMAIL PROTECTED]
 wrote:
 
 
 David:
 
 IMHO, this is beginning to be commercial abuse of this
 list. Please no more
 advertising.
 
 (Others may have different opinions).
 
 -- Bert
 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On
 Behalf Of [EMAIL PROTECTED]
 Sent: Tuesday, October 28, 2008 9:33 AM
 To: r-help@r-project.org
 Subject: [R] Recommended R books by XLSolutions Corporation
 
 
   We've listed books we've recommended to our
 introductory R/R-PLUS courses
   attendees
 
 
 
   [1]http://www.experience-rplus.com/books.asp
 
 
 
   If you'd like to recommend a book, email 
 [EMAIL PROTECTED]
 
 
 
   R-PLUS  Rocks!
 
 
 
 
 
   R-PLUS  Team
 
   24 Hours Tech Support
 
   Think Fast, Think Big, Without The High Cost!
 
   [3]www.Experience-Rplus.com/Conference.asp
 
   USAR2009, Las Vegas USAR|Rplus Conference.
 
   April 26-30, 2009 !
 
 References
 
   Visible links
   1. http://www.experience-rplus.com/books.asp
   2. mailto:[EMAIL PROTECTED]
   3. http://www.experience-rplus.com/Conference.asp
 
   Hidden links:
   4. http://www.experience-rplus.com/Conference.asp
   5. http://www.experience-rplus.com/Conference.asp
 __
 R-help@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.
 
 __
 R-help@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.
 
 
 
 
 
 -- 
 David Smith [EMAIL PROTECTED]
 Director of Community, REvolution Computing
 www.revolution-computing.com
 Tel: +1 (206) 577-4778 x3203 (Seattle, USA)
 
 
   [[alternative HTML version deleted]]
 
 __
 R-help@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.

__
R-help@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.


Re: [R] color individual bar of histogram?

2008-10-28 Thread Peter Dalgaard
Whit Armstrong wrote:
 Anyone know a quick way to color one bar of a histogram?
 
 I want to mark the bar in which the most recent observation falls.
 
 So, for instance:
 
 x - rnorm(100)
 latest.ob - x[100]
 hist(x)
 ## how do I mark the bucket that latest.ob falls into?
 

Something like this:

x - rnorm(100)
(latest.ob - x[100])
h - hist(x)
bin - as.numeric(cut(latest.ob, h$breaks)) # need as.numeric for bin+1
lw - h$breaks[bin]
up - h$breaks[bin+1]
sz - h$counts[bin]
rect(lw,0,up,sz,col=red)




-- 
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
R-help@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.


Re: [R] color individual bar of histogram?

2008-10-28 Thread Whit Armstrong
That's great, Peter.

Thanks very much.

-Whit


On Tue, Oct 28, 2008 at 3:13 PM, Peter Dalgaard
[EMAIL PROTECTED] wrote:
 Whit Armstrong wrote:
 Anyone know a quick way to color one bar of a histogram?

 I want to mark the bar in which the most recent observation falls.

 So, for instance:

 x - rnorm(100)
 latest.ob - x[100]
 hist(x)
 ## how do I mark the bucket that latest.ob falls into?


 Something like this:

 x - rnorm(100)
 (latest.ob - x[100])
 h - hist(x)
 bin - as.numeric(cut(latest.ob, h$breaks)) # need as.numeric for bin+1
 lw - h$breaks[bin]
 up - h$breaks[bin+1]
 sz - h$counts[bin]
 rect(lw,0,up,sz,col=red)




 --
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
  (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
 ~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907


__
R-help@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.


Re: [R] color individual bar of histogram?

2008-10-28 Thread Henrique Dallazuanna
Other option without rect is:

h - hist(x, plot = FALSE)
bin - as.numeric(cut(latest.ob, h$breaks))
plot(h, col = replace(rep(white, length(h$breaks) - 1), bin, red))

On Tue, Oct 28, 2008 at 4:48 PM, Whit Armstrong [EMAIL PROTECTED]wrote:

 Anyone know a quick way to color one bar of a histogram?

 I want to mark the bar in which the most recent observation falls.

 So, for instance:

 x - rnorm(100)
 latest.ob - x[100]
 hist(x)
 ## how do I mark the bucket that latest.ob falls into?


 Thanks,
 Whit

 __
 R-help@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.




-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40 S 49° 16' 22 O

[[alternative HTML version deleted]]

__
R-help@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.


[R] slightly OT: (un)supervised clustering?

2008-10-28 Thread viktoras didziulis

Hi,

my question is not exactly about R... What I am looking for are hints 
and directions on suitable methods (available in R or elsewhere)  to 
solve a grouping (or pattern recognition) problem of environmental 
features in an environmental gradient as described below.


Given environmental sampling data set  (Depth, Presence of sand, 
Presence of boulders, Presence of clay).

1 1 1 0
1 1 0 0
1 1 1 0
2 1 1 0
3 1 1 0
3 1 1 0
4 1 1 0
5 1 0 0
5 1 0 0
5 1 1 0
5 1 0 0
6 1 0 0
6 1 0 0
6 1 1 0
7 1 0 1
7 1 0 0
8 1 0 1
9 1 1 1
9 1 0 1
9 1 0 1

Once I have sampling data ordered by depth, using my own expert 
opinion I can distinguish 3 groups A, B, C: A (1 - 4 m depth range) - 
where both sand and boulders are present, B (5 - 6 m range) - where sand 
is dominant with just a few observations of boulders, C (7 - 9 m range) 
- substrate dominated by sand and clay.


Now the question - is there any formal method that can do the same e.g. 
separate the groups A, B and C by analyzing how does feature occurrence 
patterns change in samples along an environmental gradient (depth in 
this case)? Sample dataset here is simplified, in fact I have to deal 
with a dozen of features like salinity, exposure and related species 
lists. I see these groups as an expert, but it would be nice having a 
helper algorithm to see the groups for me, so I could describe it in 
Methods section of my writings :-)


Similarity matrix and Cluster analysis or MDS do not perform as 
expected, because it groups stations from group A together with stations 
of other groups that have most similar substrate observations e.g. it 
ignores environmental gradient.
Discriminant analysis expects me to do the grouping and then it will 
decide the rest. Therefore not suitable.
A bunch of significance tests can help in deciding whether the 
differences are statistically significant. But again, I have to present 
my own groups, therefore - not suitable.
Other unsupervised learning algorithms (Neural Networks  Co) - well, 
how can I instruct them to do analysis along an environmental gradient 
of depth ?..


If anyone among the experts on this list has dealt with similar problems 
before I would highly appreciate if you could briefly describe your 
approaches or point to the right sources.


And in general I am interested in approaches of locating discontinuities 
in data patterns sampled along environmental gradients.


Best wishes!
Viktoras Didziulis
P.S. just subscribed to this list, sorry if I'm missing something

__
R-help@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.


Re: [R] Recommended R books by XLSolutions Corporation

2008-10-28 Thread David M Smith
David Andrew Smith from XL Solutions emailed me privately to clear up the
confusion, too (thanks, David A).  To avoid any future confusion, I'll use
my middle initial (M) from now on.

To get this thread back to R and statistics, there might be an interesting
counting problem here somewhere. :)  What are the chances that two David
Smiths could both be working for companies in the US that support R?

I'm not a geneaologist, but the US census bureau publishes some statistics
on the frequency of names here:

http://www.census.gov/genealogy/names/names_files.html

David is the sixth most common first name in the US (with a frequency of
2.363%) and Smith is the most common last name (with a frequency of
1.006%).   Now, presumably first and last names aren't chosen independently
(choice of a first name that in the same ethnic domain as the second comes
immediately to mind), but I don't know of any first/last name frequency
data.  Anyway, let's be naive and say that of the approximately 138M males
in the US population (http://www.census.gov/prod/2005pubs/censr-20.pdf),
0.024% are called David Smith, for a total of about 33,000 individuals.

This is the bit where I get stuck.  If we narrow the problem to just R
users, I need an estimate of the size of the population of R users to go
forward.  (Anyone have any info on that?)  Then we'd need to limit it to R
users working for R companies and...

And then, on reflection, I guess we should be simply calculating the
likelihood that two individuals in a population have the same name (given
that the common name was David Smith was only established after the fact),
which makes it a complex form of the Birthday Problem.  Hmmm.  Any
geneaologists want to chime in?

# David M Smith

-- 
David Smith [EMAIL PROTECTED]
Director of Community, REvolution Computing www.revolution-computing.com
Tel: +1 (206) 577-4778 x3203 (Seattle, USA)

On Tue, Oct 28, 2008 at 11:57 AM, eugene dalt [EMAIL PROTECTED] wrote:

  I attended a course at XLSolutions and glad they can publish a list of
 recommended R books.

 IMHO they shouldn't  post it here though.

 This name issue is hilarious given thousands of David Smith out there but
 to cut the story short, my class at XLSolutions was taught by a David Andrew
 Smith who prefers to be called Drew because there are 2 David smith in his
 department.

 My 2 cents !




[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] How to export text into separate text files

2008-10-28 Thread Lauri Nikkinen
I think I found the solution:

for (i in 1:ncol(r)) {
cat(Some text,, \n, file=paste(temp, i, .txt), append=T)
cat(\n, file=paste(temp, i, .txt), append=T)
cat(More text, More text, More text, file=paste(temp, i,
.txt), append=T)
cat(\n, file=paste(temp, i, .txt), append=T)
cat(paste(names(r[!is.na(r[,i]), i]), :,
as.character(r[!is.na(r[,i]), i]), \n), file=paste(temp, i,
.txt), append=T)
cat(---, \n,
file=paste(temp, i, .txt), append=T)
}

-Lauri

2008/10/28 Lauri Nikkinen [EMAIL PROTECTED]:
 Thanks for the response. I have used the method Jim Holtman suggested
 when exporting data.frames. In the current situation, I'm combining
 text and data from data.frame, and I don't know how to separate the
 results into the separate text files. I can output everything from the
 loop into a single file using

 output - file(temp.txt, w)
 for (i in 1:ncol(r)) {
cat(Some text,, \n, file=output)
cat(\n, file=output)
cat(More text, More text, More text, file=output)
cat(\n, file=output)
cat(paste(names(r[!is.na(r[,i]), i]), :,
as.character(r[!is.na(r[,i]), i]), \n), file=output)
cat(---, \n, file=output)
 }
 close(output)

 but then I'm stuck. I'm not sure how to edit the code from here.

 Best regards,
 Lauri

 2008/10/28 John Kane [EMAIL PROTECTED]:

 jim holtman [EMAIL PROTECTED]  just answered a similar question for 
 someone who wanted to input txt files.  His suggestion is below.  It should 
 work for output as well

 Jim Holtman's suggestion.
 -

 for (i in 2:4){
input - read.delim(paste('vegetation_', i, '.txt', sep=''))
 process the file 
 }

 --

 --- On Tue, 10/28/08, Lauri Nikkinen [EMAIL PROTECTED] wrote:

 From: Lauri Nikkinen [EMAIL PROTECTED]
 Subject: [R] How to export text into separate text files
 To: [EMAIL PROTECTED]
 Received: Tuesday, October 28, 2008, 10:26 AM
 Hello,

 I'm producing text from my data.frame using cat
 function. I would like
 to use for loop to export each column in my data.frame into
 separate
 text files. Here is the example code

 r - t(Indometh)
 for (i in 1:ncol(r)) {
  cat(Some text,, \n)
  cat(\n)
  cat(More text, More text, More text)
  cat(\n)
  cat(paste(names(r[!is.na(r[,i]), i]), :,
 as.character(r[!is.na(r[,i]), i]), \n))
  cat(---,
 \n)
 }

 So, each of these columns (results between --- and ---)
 should be
 exported into separate text files e.g. file1.txt,
 file2.txt, file3.txt
 etc.

 Any ideas?

 Thanks,
 Lauri

 __
 R-help@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.


  __
 Connect with friends from any web browser - no download required. Try the 
 new Yahoo! Canada Messenger for the Web BETA at 
 http://ca.messenger.yahoo.com/webmessengerpromo.php



__
R-help@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.


Re: [R] Need help

2008-10-28 Thread JohnLi
Thank you very much! I solve my problem according these information.

Guichong

 Hello John.After a simple search in google, I came up with this:
 http://www.ats.ucla.edu/stat/R/seminars/Repeated_Measures/repeated_measures.htm

 Enjoy,
 Tal.



 On Mon, Oct 27, 2008 at 6:15 PM, JohnLi [EMAIL PROTECTED] wrote:

 Hi All,

   I am new comer here and for Statistics R. I want to know how to use R
 to calculate one way repeated measure ANOVA, for example, on three
 groups of data.

   I appreciate if someone can help me solve this problem.


 John

 __
 R-help@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.




 --
 --
 Tal Galili
 Phone number: 972-50-3373767
 FaceBook: Tal Galili
 My Blogs:
 www.talgalili.com
 www.biostatistics.co.il

   [[alternative HTML version deleted]]

 __
 R-help@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.


__
R-help@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.


Re: [R] color individual bar of histogram?

2008-10-28 Thread Peter Dalgaard
Henrique Dallazuanna wrote:
 Other option without rect is:
 
 h - hist(x, plot = FALSE)
 bin - as.numeric(cut(latest.ob, h$breaks))
 plot(h, col = replace(rep(white, length(h$breaks) - 1), bin, red))

Nice. Some small improvements seem possible:

h - hist(x, plot = FALSE)
bin - cut(latest.ob, h$breaks)
clr - rep(white, length(h$counts))
clr[bin] - red
plot(h, col=clr)

I.e., you don't need as.numeric for simple indexing with bin, and it
is easier to get the number of bins by counting something other than
h$breaks. I also avoided the inlined replace() construct, but that is
possibly more of a matter of taste.

 
 On Tue, Oct 28, 2008 at 4:48 PM, Whit Armstrong [EMAIL PROTECTED]wrote:
 
 Anyone know a quick way to color one bar of a histogram?

 I want to mark the bar in which the most recent observation falls.

 So, for instance:

 x - rnorm(100)
 latest.ob - x[100]
 hist(x)
 ## how do I mark the bucket that latest.ob falls into?


 Thanks,
 Whit

 __
 R-help@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.

 
 
 
 
 
 
 __
 R-help@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.


-- 
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
R-help@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.


Re: [R] Recommended R books by XLSolutions Corporation

2008-10-28 Thread Ben Bolker
David M Smith david at revolution-computing.com writes:

 
 David Andrew Smith from XL Solutions emailed me privately to clear up the
 confusion, too (thanks, David A).  To avoid any future confusion, I'll use
 my middle initial (M) from now on.
 
 To get this thread back to R and statistics, there might be an interesting
 counting problem here somewhere. :)  What are the chances that two David
 Smiths could both be working for companies in the US that support R?
 
 I'm not a geneaologist, but the US census bureau publishes some statistics
 on the frequency of names here:
 
 http://www.census.gov/genealogy/names/names_files.html
 

  See also

http://www.stat.columbia.edu/~cook/movabletype/archives/2008/09/wheres_the_othe.html

  Ben Bolker

__
R-help@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.


Re: [R] Recommended R books by XLSolutions Corporation

2008-10-28 Thread Peter Dalgaard
David M Smith wrote:

[]
 David is the sixth most common first name in the US (with a frequency of
 2.363%) and Smith is the most common last name (with a frequency of
 1.006%).   Now, presumably first and last names aren't chosen independently
 (choice of a first name that in the same ethnic domain as the second comes
 immediately to mind), but I don't know of any first/last name frequency
 data.  Anyway, let's be naive and say that of the approximately 138M males
 in the US population (http://www.census.gov/prod/2005pubs/censr-20.pdf),
 0.024% are called David Smith, for a total of about 33,000 individuals.
 
 This is the bit where I get stuck. 

Drats!! I almost thought that you had gotten a hold on the elusive
problem of estimating the population of R users

[]
 
 # David M Smith
 


-- 
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
R-help@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.


[R] How to add a data line (series) to a plot using add=TRUE

2008-10-28 Thread Mark Na

Hello,

I'd like to use the add=TRUE parameter to add a second data line 
(series) to an existing plot, but R is giving me an error (see below).


This code:
 rap-plot(aspen_sort,ylim=c(1,1),log=y)

...produces the plot to which I'd like to add the second line. But this 
code:

 rap-plot(pine_sort,add = TRUE)

...produces this error:

Warning messages:
1: In plot.window(...) : add is not a graphical parameter
2: In plot.xy(xy, type, ...) : add is not a graphical parameter
3: In axis(side = side, at = at, labels = labels, ...) :
 add is not a graphical parameter
4: In axis(side = side, at = at, labels = labels, ...) :
 add is not a graphical parameter
5: In box(...) : add is not a graphical parameter
6: In title(...) : add is not a graphical parameter

I have successfully used add=TRUE (in the same program!) with no errors, 
so I reckon the problem must be related to my data structures, but I 
can't see how.


Any ideas? Thanks!

Mark

__
R-help@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.


Re: [R] repeated measure one way anova

2008-10-28 Thread JohnLi
Thanks a lot ! I learn a lot about R while I solve my problem according to
those provided informatin.

John


 Dieter Menne wrote:
 JohnLi jli136 at site.uottawa.ca writes:
 I am a new comer for Statistics R. I am using R for one way repeated
 measure anova, for example, on the following data consisting of three
 groups.


 c2  c3  c4
 85.83   75.86   84.19
 85.91   73.18   85.9

 -- Arrange your data in the long form. Do it by hand, or use function
 pack, or
 reshape, or package reshape.

 (Assuming these are times. If these are categorical variables, better
 use
 strings as column descriptors)



 subj time conc(do not use t or c as variable name, these are
   well-known functions in R)
 A 285.83
 A 375.86
 A 484.19
 B 285.91
 

 Use package nlme, function lme. It might be a bit of an overkill for the
 simple
 case, but always worth the effort when things get more complex

 libary(nlme)
 summary(lme(c~time, random=~1|subj,data=mydata)

 There is also anova.mlm:

 d - read.table(clipboard, header=T)
 Y - as.matrix(d)
 fit1 - lm(Y~1)
 fit0 - lm(Y~0)
 anova(fit0, fit1, X=~1, test=Spherical)
 anova(fit0, fit1, X=~1, test=Wilks)

 --
 O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
   (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
 ~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

 __
 R-help@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.


__
R-help@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.


Re: [R] slightly OT: (un)supervised clustering?

2008-10-28 Thread Dylan Beaudette
On Tuesday 28 October 2008, viktoras didziulis wrote:
 Hi,

 my question is not exactly about R... What I am looking for are hints
 and directions on suitable methods (available in R or elsewhere)  to
 solve a grouping (or pattern recognition) problem of environmental
 features in an environmental gradient as described below.

 Given environmental sampling data set  (Depth, Presence of sand,
 Presence of boulders, Presence of clay).
 1 1 1 0
 1 1 0 0
 1 1 1 0
 2 1 1 0
 3 1 1 0
 3 1 1 0
 4 1 1 0
 5 1 0 0
 5 1 0 0
 5 1 1 0
 5 1 0 0
 6 1 0 0
 6 1 0 0
 6 1 1 0
 7 1 0 1
 7 1 0 0
 8 1 0 1
 9 1 1 1
 9 1 0 1
 9 1 0 1

Are these bore-hole logs? If so check the literature in geophysics / earth 
science / soil science.

 Once I have sampling data ordered by depth, using my own expert
 opinion I can distinguish 3 groups A, B, C: A (1 - 4 m depth range) -
 where both sand and boulders are present, B (5 - 6 m range) - where sand
 is dominant with just a few observations of boulders, C (7 - 9 m range)
 - substrate dominated by sand and clay.

hmm. I get something like that with a simple call to pam():

# need this
library(cluster)

# had to make your data into something useable first...
# partition into 4 groups
x.pam - pam(x, k=4)

# add the clustering vector back to your original data:
x$cluster - x.pam$clustering

# looks like this
   X1 X2 X3 X4 cluster
1   1  1  1  0   1
2   1  1  0  0   1
3   1  1  1  0   1
4   2  1  1  0   1
5   3  1  1  0   1
6   3  1  1  0   1
7   4  1  1  0   2
8   5  1  0  0   2
9   5  1  0  0   2
10  5  1  1  0   2
11  5  1  0  0   2
12  6  1  0  0   3
13  6  1  0  0   3
14  6  1  1  0   3
15  7  1  0  1   3
16  7  1  0  0   3
17  8  1  0  1   4
18  9  1  1  1   4
19  9  1  0  1   4
20  9  1  0  1   4

Not sure if that is meaningful-- if you are interested in the methods from the 
cluster package, be sure to get the book that it is based on.

 Now the question - is there any formal method that can do the same e.g.
 separate the groups A, B and C by analyzing how does feature occurrence
 patterns change in samples along an environmental gradient (depth in
 this case)? Sample dataset here is simplified, in fact I have to deal
 with a dozen of features like salinity, exposure and related species
 lists. I see these groups as an expert, but it would be nice having a
 helper algorithm to see the groups for me, so I could describe it in
 Methods section of my writings :-)

This is a classic problem of variation in some property along some axis of 
anisotropy-- I tend to see this in my field as variation in soil properties 
with depth -aka- horizons.


 Similarity matrix and Cluster analysis or MDS do not perform as
 expected, because it groups stations from group A together with stations
 of other groups that have most similar substrate observations e.g. it
 ignores environmental gradient.

What happens if you were to include some indicator of the gradient in the 
unsupervised classification? See the example above where I included the 
depth.


 Discriminant analysis expects me to do the grouping and then it will
 decide the rest. Therefore not suitable.
 A bunch of significance tests can help in deciding whether the
 differences are statistically significant. But again, I have to present
 my own groups, therefore - not suitable.
 Other unsupervised learning algorithms (Neural Networks  Co) - well,
 how can I instruct them to do analysis along an environmental gradient
 of depth ?..

if you have an idea on the number of groupings you are looking for, then the 
pam() and clara() functions in the cluster package may do what you need. 
These are especially nice as they can deal with continuous, ordinal, and 
binary variables. If you do not know how many groups there may be, see the 
diana() and daisy() functions. With all of these use of the 'stand=TRUE' 
argument will be important if your variables are on different scales.

# an example using data from above:
x.hc - as.hclust(diana(daisy(x[,1:4], stand=TRUE)))
x.hc$labels - x$cluster
plot(x.hc)

 If anyone among the experts on this list has dealt with similar problems
 before I would highly appreciate if you could briefly describe your
 approaches or point to the right sources.

 And in general I am interested in approaches of locating discontinuities
 in data patterns sampled along environmental gradients.

The soil science literature may have some relevent insight into this matter.

Good luck,

Dylan


 Best wishes!
 Viktoras Didziulis
 P.S. just subscribed to this list, sorry if I'm missing something

 __

-- 
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 

Re: [R] acf(): meaning of the blue horizontal lines

2008-10-28 Thread David Scott

On Tue, 28 Oct 2008, Oliver Bandel wrote:


Hello,

what are they meaning? It could be something that
would show a threshhold above which the result is
indicating different meanings then just random noise.
But there is no description on the definition of those lines,
so it means nothing, if it is not clearly defined.

Where can I find a detailed definiton?


Ciao,
  Oliver



Look at

?plot.acf

for which there is a pointer on the help to acf:
'The generic function plot has a method for objects of class acf. '

Note that if you can't guess what the lines are on the acf plot you don't 
know enough about time series to be using an acf plot and had best get a 
book on time series and read it. Any standard reference on time series 
should explain it, for example Chatfield: The Analysis of Time Series.


David Scott

_
David Scott Department of Statistics, Tamaki Campus
The University of Auckland, PB 92019
Auckland 1142,NEW ZEALAND
Phone: +64 9 373 7599 ext 86830 Fax: +64 9 373 7000
Email:  [EMAIL PROTECTED]

Graduate Officer, Department of Statistics
Director of Consulting, Department of Statistics

__
R-help@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.


Re: [R] acf() plots of a data.frame: what meaning?

2008-10-28 Thread David Scott

On Tue, 28 Oct 2008, Oliver Bandel wrote:


Hello,

what is the meaning of the plots of an acf()-plot,
when using a data frame as argument?

The result is NOT obvious for me.

There are combinations of the columns of a dataframe in the reulting
plot.
But an acf() is just defined for onyl one time-sreies.
So what do the plots mean? I did not found a description in the
help-page.




Well if you insist on supplying a dataframe to a function which accepts 
only a time series or numeric vector or matrix you are on your own. The 
help says:


x, y a univariate or multivariate (not ccf) numeric time series object or 
a numeric vector or matrix, or an acf object.


If you supply a multivariate object the help example: 
acf(ts.union(mdeaths, fdeaths))
shows that you get the individual acf plot and cross-correlation plots 
(for which you should be aware that order matters).


David Scott

_
David Scott Department of Statistics, Tamaki Campus
The University of Auckland, PB 92019
Auckland 1142,NEW ZEALAND
Phone: +64 9 373 7599 ext 86830 Fax: +64 9 373 7000
Email:  [EMAIL PROTECTED]

Graduate Officer, Department of Statistics
Director of Consulting, Department of Statistics

__
R-help@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.


[R] get coordinates to multi file

2008-10-28 Thread Alessandro
Hi All,

 

I need to understand How I could to get coordinate to multi-files in a some
code:

I import X,Y,Z txt  files (=vegetation_2.txt, vegetation_3.txt,
vegetation_4.txt, etc etc.) with 

 

for(i in 2:4)

assign(paste('vegetation',i,sep='_'),read.delim(paste('vegetation_',i,'.txt'
,sep='')))

 

to do my spatial analysis I need to get coordinate to this files. Normally
for one file I use

 

coordinates(vegetation_2) =~X+Y  

 

but I must processing several and several files and I wish to know the
methodology to create a loop formula.

 

Thanks

 

Ale

 


[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] does qplot works with Sweave?

2008-10-28 Thread hadley wickham
You need to explicitly print ggplot objects:
print(qplot(carat,price,data=dsmall,colour = color))

Hadley

On Tue, Oct 28, 2008 at 3:43 PM, Felipe Carrillo
[EMAIL PROTECTED] wrote:
 Hi Hadley:
 I'm practicing writing a document using MikTex but can't make qplot to 
 execute. It works when using 'plot' though. Is this a normal behaviour?


 \documentclass[9pt]{article}
  \title{ggplot2 example}

 \begin{document}

 \maketitle
 \section*{Examples of using ggplot2}
  The goal is to be able to import ggplot2 graphics into the annual report.
 Hadley Wickham has done a great job by creating this free R package.
 Let's get some data into R from one the built-in packages:
  We'll work with the diamonds data. This dataset is really large, it accounts 
 for
 over 50.000 records. We will demostrate  how to create nice and colorful 
 graphics
 as well as creating some nice tabular tables with  horizontal and vertical 
 lines.

  dataAnalysis.R,echo=F=
 data(diamonds)
 attach(diamonds)
 dsmall - diamonds[sample(nrow(diamonds),1000),]
 @
 \begin{figure}[h]
 fig.R,echo=FALSE,fig=TRUE,width=6,height=7=
 qplot(carat,price,data=dsmall,colour = color)  #THIS CODE DOESN'T WORK
 @
 \end{figure}


 Felipe D. Carrillo
 Supervisory Fishery Biologist
 Department of the Interior
 US Fish  Wildlife Service
 California, USA

 __
 R-help@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.




-- 
http://had.co.nz/

__
R-help@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.


Re: [R] Fitting weibull and exponential distributions to left censoring data

2008-10-28 Thread Fernando Marmolejo Ramos
Dear Barja

Have you looked at gamlss y gamlss.dist libaries?

There some functions called WEI, WEI2, and WEI3

Cheers,

Fer

__
R-help@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.


[R] outputting (writing) output into a dataframe

2008-10-28 Thread Farrel Buchinsky
I have solved this problem once before but don't recall exactly how.
Is there a url that shows how?

What I want to do now is quite specific but my query is actually very general

There are many functions in which one specifies several parameters and
an output is generated. Well what happens if one wants to specify a
range of parameters and have the output written to a data frame.

To demonstrate:

p1 -15:25/100# so that I can vary the p1 from 0.15 to 0.25

for (i in p1)  print(power.prop.test(p1=i,p2=0.5*i,power=0.8, sig.level=0.05))

That prints a whole flurry of pretty outputs but I actually want it to
output into a data frame so that I can plot it?

Farrel Buchinsky

__
R-help@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.


[R] Distributions Comparison

2008-10-28 Thread Igor Telezhinsky
Dear all,

I have recently found out about the R project. Could anyone tell me if it is
possible to make the comparison of two distributions using R packages? The
problem is TRICKY because I have the distributions of measurements and each
measurement in the given distribution has its own error, which I need to
take into account when comparing these distributions. If anyone knows it is
possible with R, could you please tell me what package to use. I will really
appreciate some hints in code as well.

 

Thank you.

 

With kind regards,

Igor.  


[[alternative HTML version deleted]]

__
R-help@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.


[R] Saving a 3d array into a matlab file

2008-10-28 Thread Minho Chae
Dear R users,

I am tryting to save an 3d array to a matlab file like the following.

A - array(1:24, c(2,3,4))
writeMat(filename, A=A)

But if I load the mat file from Matlab, it is not 3d matrix anymore.
Does anyone know how I can preserve the 3d structure?
Any help will be greatly appreciated.

Minho Chae

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] How to add a data line (series) to a plot using add=TRUE

2008-10-28 Thread stephen sefick
add is not a graphical parameter

On Tue, Oct 28, 2008 at 3:49 PM, Mark Na [EMAIL PROTECTED] wrote:
 Hello,

 I'd like to use the add=TRUE parameter to add a second data line (series) to
 an existing plot, but R is giving me an error (see below).


try (untested):
plot(aspen_sort,ylim=c(1,1),log=y)
lines(pine_sort)



 ...produces this error:

 Warning messages:
 1: In plot.window(...) : add is not a graphical parameter
 2: In plot.xy(xy, type, ...) : add is not a graphical parameter
 3: In axis(side = side, at = at, labels = labels, ...) :
  add is not a graphical parameter
 4: In axis(side = side, at = at, labels = labels, ...) :
  add is not a graphical parameter
 5: In box(...) : add is not a graphical parameter
 6: In title(...) : add is not a graphical parameter

 I have successfully used add=TRUE (in the same program!) with no errors, so
 I reckon the problem must be related to my data structures, but I can't see
 how.

 Any ideas? Thanks!

 Mark

 __
 R-help@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.




-- 
Stephen Sefick
Research Scientist
Southeastern Natural Sciences Academy

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

-K. Mullis

__
R-help@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.


[R] Repository missing hmisc

2008-10-28 Thread David Huffer
I'm trying to install the Hmisc package, however it doesn't appear in
the list after utils:::menuInstallPkgs().  Any help?

--
 David

__
R-help@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.


Re: [R] Sweave, Bibtex, package references

2008-10-28 Thread ONKELINX, Thierry
Paolo,

Try using \nocite{*}. That will cite every entry in your bibliography.

HTH,

Thierry




ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium 
tel. + 32 54/436 185
[EMAIL PROTECTED] 
www.inbo.be 

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey

-Oorspronkelijk bericht-
Van: Paolo Sonego [mailto:[EMAIL PROTECTED] 
Verzonden: dinsdag 28 oktober 2008 18:08
Aan: ONKELINX, Thierry
CC: R-List Help - use this to post
Onderwerp: Re: [R] Sweave, Bibtex, package references

Dear Thierry,

Thank you very much for you very useful advice!
I managed to solve my specific problem with this code:

echo=FALSE=
package - grep(^package:, search(), value = TRUE)
keep - sapply(package, function(x) x == package:base || 
!is.null(attr(as.environment(x), path)))
package - sub(^package:, , package[keep])
pkgDesc - lapply(package, packageDescription)
basePkgs - sapply(pkgDesc, function(x) !is.null(x$Priority) 
x$Priority == base)
otherPkgs - package[!basePkgs]
cite.by.name - function(x){
 res - toBibtex(citation(x))
 if (is.list(res)) res - res[[1]]
 res[1] - sub({,paste({,x,sep=''),res[1],fixed=TRUE)
 res
}
# suppressWarnings(cite.by.name(annotate))
tmp - sapply( otherPkgs, function(x) try( cite.by.name(x) ) )
for (i in 1:length(tmp)){
capture.output(tmp[[i]], file= Rpackages.bib, append=T)
}
@


It does work, more or less, but still I need to write manually one by 
one  \nocite{otherPkgs[[1]]} \nocite{otherPkgs[[2]]} etc.
in order to pop up the references in the Bibliography section
\bibliographystyle{abbrv}
\bibliography{Rpackages}


Any idea how to automate this procedure?

Best Regards,
Paolo

ONKELINX, Thierry ha scritto:
 Dear Paolo,

 Have a look at this thread:

http://www.nabble.com/Automating-citations-in-Sweave-td20128175.html#a20
 128175

 HTH,

 Thierry




 
 ir. Thierry Onkelinx
 Instituut voor natuur- en bosonderzoek / Research Institute for Nature
 and Forest
 Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
 methodology and quality assurance
 Gaverstraat 4
 9500 Geraardsbergen
 Belgium 
 tel. + 32 54/436 185
 [EMAIL PROTECTED] 
 www.inbo.be 

 To call in the statistician after the experiment is done may be no
more
 than asking him to perform a post-mortem examination: he may be able
to
 say what the experiment died of.
 ~ Sir Ronald Aylmer Fisher

 The plural of anecdote is not data.
 ~ Roger Brinner

 The combination of some data and an aching desire for an answer does
not
 ensure that a reasonable answer can be extracted from a given body of
 data.
 ~ John Tukey

 -Oorspronkelijk bericht-
 Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
 Namens Paolo Sonego
 Verzonden: dinsdag 28 oktober 2008 12:41
 Aan: R-List Help - use this to post
 Onderwerp: [R] Sweave, Bibtex, package references

 Dear all,
 I'm a big fan and happy user of the Sweave package for routine
 reporting.
  From inside a .Rnw script, I'd like to produce the references in
bibtex

 format for each package loaded in the environment, write them in a
.bib 
 file  and load them back from the
 \bibliography{bibliography} statement.
 Is this feasible?
 Any help would be greatly appreciated!
 Thanks in advance,
 Paolo

 __
 R-help@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.

 Dit bericht en eventuele bijlagen geven enkel de visie van de
schrijver weer 
 en binden het INBO onder geen enkel beding, zolang dit bericht niet
bevestigd is
 door een geldig ondertekend document. The views expressed in  this
message 
 and any annex are purely those of the writer and may not be regarded
as stating 
 an official position of INBO, as long as the message is not confirmed
by a duly 
 signed document.
   


Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer 
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in  this message 
and any annex are purely those of the writer and may not be regarded as stating 
an official position of INBO, as long as the message is not 

Re: [R] Distributions Comparison

2008-10-28 Thread Rolf Turner


On 29/10/2008, at 10:53 AM, Igor Telezhinsky wrote:


Dear all,

I have recently found out about the R project. Could anyone tell me  
if it is
possible to make the comparison of two distributions using R  
packages? The
problem is TRICKY because I have the distributions of measurements  
and each
measurement in the given distribution has its own error, which I  
need to
take into account when comparing these distributions. If anyone  
knows it is
possible with R, could you please tell me what package to use. I  
will really

appreciate some hints in code as well.


Your message is almost completely opaque to me.  What do you actually  
want
to do?  What do you mean by ``distributions''?  Do you actually know  
those
distributions (unlikely!) or do you have a sample from each of those  
distributions?


What do you mean by ``compare''?  Do you simply want to *test*  
whether the
distributions are indeed different (on the basis of the given ---  
presumably ---
samples)?  Or do you want to calculate/estimate some measure of the  
difference?

What measure?

It sounds to me like your knowledge of statistics is to say the least  
limited.
You can't expect the R system, wonderful as it is, to make up for  
this lack
of knowledge.  Learn some statistics first, before you try to do a  
statistical

analysis.

cheers,

Rolf Turner

P. S. If just want to test for a difference between two distributions/ 
populations
on the basis of independent samples from each of those distributions,  
then you can

use the function ks.test().

R. T.

##
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

__
R-help@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.


  1   2   >