RE: [R] Strange Matrix Multiplication Behaviour

2004-10-04 Thread Wayne Jones
Thanks for your help folks. 

I was not aware of the column wise nature of R multiplication. 

regards

Wayne


-Original Message-
From: Arne Henningsen [mailto:[EMAIL PROTECTED] 
Sent: 04 October 2004 16:09
To: [EMAIL PROTECTED]
Cc: Wayne Jones
Subject: Re: [R] Strange Matrix Multiplication Behaviour

Hi Wayne,

are you aware that you are NOT doing matrix multiplication? A matrix 
multiplication is done by %*%, e.g.
> tr %*% t(as.matrix(ex1)

Or do you want a normal scalar multiplication with the elements of each row
of 
ex1 to be multiplied with the corresponding element of tr? However, R does 
the multiplication not row-wise, but column-wise. Thus, the results are not 
as you expected. To do a row-wise multiplication you can transform the 
data.frame:

> tr <- as.vector(10*c(1:6))
> tr
[1] 10 20 30 40 50 60
> ex1 <- as.data.frame(matrix(1:12,nrow=2,byrow=TRUE))
> ex1
  V1 V2 V3 V4 V5 V6
1  1  2  3  4  5  6
2  7  8  9 10 11 12
> tr * ex1
   V1  V2  V3  V4  V5  V6
1  10  60 150  40 150 300
2 140 320 540 200 440 720
> t( tr * t(ex1) )
  V1  V2  V3  V4  V5  V6
1 10  40  90 160 250 360
2 70 160 270 400 550 720
> t( tr * t(ex1) )[1,]
 V1  V2  V3  V4  V5  V6
 10  40  90 160 250 360
> t( tr * t(ex1[1,]) )
  V1 V2 V3  V4  V5  V6
1 10 40 90 160 250 360

I hope that this makes it clear.

Best wishes,
Arne


On Monday 04 October 2004 16:10, Wayne Jones wrote:
> Hi there fellow R-users,
>
> Im seeing some strange behaviour when I multiply a vector by a matrix
>
> Here is my script:
> > tr
>
> 1 2 3 4 5 6
> 0.2217903 0.1560525 0.1487908 0.1671354 0.1590643 0.1471667
>
> > ex1
>
>a b  c  d  e  f
> 1  0.2309579 -3.279045 -0.6694697 -1.1024404  0.2303928 -1.5527404
> 2 -0.2865357 -2.519789 -0.1138712 -0.3571832 -2.6727913 -0.3296945
>
> > is.vector(tr)
>
> [1] TRUE
>
> > is.data.frame(ex1)
>
> [1] TRUE
>
> > tr* ex1[1,]
>
>a  b   c  d  e  f
> 1 0.05122423 -0.5117031 -0.09961092 -0.1842569 0.03664727 -0.2285117
>
> > (tr* ex1)[1,]
>
>a  b  c  d  e  f
> 1 0.05122423 -0.4878917 -0.1064887 -0.2445106 0.03428033 -0.2469855
>
>
> Notice that the output from tr * ex[1,] is different from (tr* ex1)[1,]
> Especially element number 4.
>
> I would naturally expect both vectors to be equivalent.
>
>
> Can anyone shed any light on my predicament??
>
> > version
>
>  _
> platform i386-pc-mingw32
> arch i386
> os   mingw32
> system   i386, mingw32
> status
> major1
> minor9.1
> year 2004
> month06
> day  21
> language R
>
>
>
> Regards
>
> Wayne Jones
>
>
>
>
>
>
> KSS Ltd
> Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS 
> England Company Registration Number 2800886
> Tel: +44 (0) 161 228 0040 Fax: +44 (0) 161 236 6305
> mailto:[EMAIL PROTECTED]  http://www.kssg.com
>
>
> The information in this Internet email is confidential and m...{{dropped}}
>
> __
> [EMAIL PROTECTED] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

-- 
Arne Henningsen
Department of Agricultural Economics
University of Kiel
Olshausenstr. 40
D-24098 Kiel (Germany)
Tel: +49-431-880 4445
Fax: +49-431-880 1397
[EMAIL PROTECTED]
http://www.uni-kiel.de/agrarpol/ahenningsen/

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Strange Matrix Multiplication Behaviour

2004-10-04 Thread Wayne Jones

Hi there fellow R-users, 

Im seeing some strange behaviour when I multiply a vector by a matrix

Here is my script: 

> tr
1 2 3 4 5 6 
0.2217903 0.1560525 0.1487908 0.1671354 0.1590643 0.1471667 
> 
> ex1
   a b  c  d  e  f
1  0.2309579 -3.279045 -0.6694697 -1.1024404  0.2303928 -1.5527404
2 -0.2865357 -2.519789 -0.1138712 -0.3571832 -2.6727913 -0.3296945

> is.vector(tr)
[1] TRUE

> is.data.frame(ex1)
[1] TRUE

> tr* ex1[1,]
   a  b   c  d  e  f
1 0.05122423 -0.5117031 -0.09961092 -0.1842569 0.03664727 -0.2285117

> (tr* ex1)[1,]
   a  b  c  d  e  f
1 0.05122423 -0.4878917 -0.1064887 -0.2445106 0.03428033 -0.2469855


Notice that the output from tr * ex[1,] is different from (tr* ex1)[1,]
Especially element number 4. 

I would naturally expect both vectors to be equivalent. 


Can anyone shed any light on my predicament??



> version
 _  
platform i386-pc-mingw32
arch i386   
os   mingw32
system   i386, mingw32  
status  
major1  
minor9.1
year 2004   
month06 
day  21 
language R      



Regards

Wayne Jones






KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] t test problem?

2004-09-22 Thread Wayne Jones
Hi Kan Lui, 

I've had a quick look at the data. The logged data seems reasonably nicely
distributed (roughly symmetrical + equal variance). Indeed the y variable
passed the (very strict) shapiro.test for normality. 

However the main problem is that I do not get the same results as you for
the significance of the t.test. 

The only significant test I see is the paired t.test on the logged data. Is
your data paired data? To see what I mean check out:
http://www.texasoft.com/winkpair.html

The non-parametric tests show no significance (paired data or not) (logged
and natural data). Although in general they do tend to be less strict than
parametric tests. 

Unless the data is paired then the means of these samples most certainly do
not significantly differ from one another.



Here are my workings: 

Temp.Dat<-read.table("data_natural.txt",header=T)


hist(log(Temp.Dat$x,10))
hist(log(Temp.Dat$y,10))

shapiro.test(log(Temp.Dat$x,10))
shapiro.test(log(Temp.Dat$y,10))

t.test(log(Temp.Dat$x,10), log(Temp.Dat$y,10))


   Welch Two Sample t-test

data:  log(Temp.Dat$x, 10) and log(Temp.Dat$y, 10) 
t = 0.9126, df = 195.806, p-value = 0.3626
alternative hypothesis: true difference in means is not equal to 0 
95 percent confidence interval:
 -0.0599837  0.1633168 
sample estimates:
mean of x mean of y 
 4.891313  4.839647


> t.test(log(Temp.Dat$x,10), log(Temp.Dat$y,10),paired=T)

Paired t-test

data:  log(Temp.Dat$x, 10) and log(Temp.Dat$y, 10) 
t = 2.3535, df = 98, p-value = 0.02060
alternative hypothesis: true difference in means is not equal to 0 
95 percent confidence interval:
 0.008101002 0.095232132 
sample estimates:
mean of the differences 
 0.05166657 

> wilcox.test(log(Temp.Dat$x,10), log(Temp.Dat$y,10),paired=T)

Wilcoxon signed rank test with continuity correction

data:  log(Temp.Dat$x, 10) and log(Temp.Dat$y, 10) 
V = 2972.5, p-value = 0.0828
alternative hypothesis: true mu is not equal to 0 

> wilcox.test(log(Temp.Dat$x,10), log(Temp.Dat$y,10),paired=F)

Wilcoxon rank sum test with continuity correction

data:  log(Temp.Dat$x, 10) and log(Temp.Dat$y, 10) 
W = 5206, p-value = 0.4491
alternative hypothesis: true mu is not equal to 0



> wilcox.test(Temp.Dat$x, Temp.Dat$y,paired=F)

Wilcoxon rank sum test with continuity correction

data:  Temp.Dat$x and Temp.Dat$y 
W = 5206, p-value = 0.4491
alternative hypothesis: true mu is not equal to 0 

> wilcox.test(Temp.Dat$x, Temp.Dat$y,paired=T)

Wilcoxon signed rank test with continuity correction

data:  Temp.Dat$x and Temp.Dat$y 
V = 2896.5, p-value = 0.1417
alternative hypothesis: true mu is not equal to 0 

> t.test(Temp.Dat$x, Temp.Dat$y,paired=T)

Paired t-test

data:  Temp.Dat$x and Temp.Dat$y 
t = 1.6731, df = 98, p-value = 0.0975
alternative hypothesis: true difference in means is not equal to 0 
95 percent confidence interval:
 -2351.81 27623.53 
sample estimates:
mean of the differences 
   12635.86 

> t.test(Temp.Dat$x, Temp.Dat$y,paired=F)

Welch Two Sample t-test

data:  Temp.Dat$x and Temp.Dat$y 
t = 0.6432, df = 191.177, p-value = 0.5209
alternative hypothesis: true difference in means is not equal to 0 
95 percent confidence interval:
 -26116.18  51387.89 
sample estimates:
mean of x mean of y 
 120544.9  107909.0 

>

-Original Message-
From: kan Liu [mailto:[EMAIL PROTECTED] 
Sent: 22 September 2004 10:22
To: Andrew Robinson; Dimitris Rizopoulos
Cc: [EMAIL PROTECTED]
Subject: Re: [R] t test problem?

Hi, Many thanks for your helpful comments and suggestions. The attached are
the data in both log10 scale and original scale. It would be very grateful
if you could suggest which version of test should be used. 
 
By the way, how to check whether the variation is additive (natural scale)
or multiplicative (log scale) in R? How to check whether the distribution of
the data is normal? 
 
PS, Can I confirm that do your suggestions mean that in order to check
whether there is a difference between x and y in terms of mean I need check
the distribution of x and that of y in both natual and log scales and to see
which present normal distribution? and then perform a t test using the data
scale which presents normal distribution? If both scales present normal
distribution, then the t tests with both scales should give the similar
results?
 
 
 
Thanks again.
 
Liu

Andrew Robinson <[EMAIL PROTECTED]> wrote:
Hi Dimitris,

you are describing a more stringent requirement than the t-test
actually requires. It's the sampling distribution of the mean that
should be normal, and this condition is addressed by the Central
Limit Theorem.

Whether or not the CLT can be invoked depends on numerous factors,
including the distribution of the sample, and the size of the sample,
neither of which we have any information about. 

Liu, the problem you describe is associated with the application of
the test rather than the test itself. The difference between log- and
natural-

RE: [R]

2004-09-22 Thread Wayne Jones

The following function will do it. But be warned it will only work if all
the input strings are lower case.


Make.To.Upper.Case<-function(my.string){

paste(LETTERS[match(strsplit(my.string,"")[[1]],letters)],collapse="")

}

Make.To.Upper.Case("jhjhaskjdakdsj")

> [1] "JHJHASKJDAKDSJ"




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: 22 September 2004 09:43
To: [EMAIL PROTECTED]
Subject: [R]

Dear Any,

Is there a fonction in R to change a string to uppercase ?

Thanks for all your help

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] S-PLUS and R

2004-09-21 Thread Wayne Jones
Save the excel file as a .csv file. 
The read about help(read.csv)

Regards

Wayne



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 21 September 2004 16:41
To: [EMAIL PROTECTED]
Subject: [R] S-PLUS and R 

Hello,

How do I import data from Excel onto R? I am using S-Plus Envstat module.
I need to use some of the data that already exist in the Envstat and put
it into R to make graphs, find basic informations like mean, median,
standard deviation, etc. I have been reading the help links, but I don't
see anything in reference to this.

Please help me!

-Maher Lina

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] newbie needs help using R as solver

2004-09-16 Thread Wayne Jones
This is a linear programming problem. Although I am not sure what your
objective function is!!

Check out the R package linprog


-Original Message-
From: Andrej Uduc [mailto:[EMAIL PROTECTED] 
Sent: 16 September 2004 10:29
To: [EMAIL PROTECTED]
Subject: [R] newbie needs help using R as solver

Greetings
I'm a total newbie in R and I'm trying to make a comparisson of Excel 
and R in the fields of:
- optimisation modeling (using solver)
-  decision trees
-  simulation modeling
as described in Winston, Wayne L.:  Practical Management Science.
for optimisation modeling in Excel I would normaly use solver. In R 
however I can't seem to be able to find the solution. I've narrowed it 
down to optim, optimize functions (I might be totaly wrong), but I can't 
figure out how to set the conditions. I've read something about nlm 
model but I can't find the anwser (examples are not easy enough for me).
what I wanna do is solve this simple task:
a+b =< 50
c+d  =< 50
g  >= 0,25*c+d
a+b+c+d+g =< 100
a, b, c, d, g => 0

I would very much appreciate any help in this matter. I need to locate 
the appropriate function for the task and figure out how to write this 
formulas. I'd also be very thankfull for any help (links) to simple 
examples of decision trees and/or simulation.
   
Andrej Uduè

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] newsgroup on R

2004-09-02 Thread Wayne Jones
Check out: 


http://cran.r-project.org/doc/Rnews/



-Original Message-
From: Bin Jiang [mailto:[EMAIL PROTECTED] 
Sent: 02 September 2004 12:09
To: [EMAIL PROTECTED]
Subject: [R] newsgroup on R

HI, I wonder if there is a newsgroup on R available, instead of 
emaillist which I have to receive mails daily.

Cheers.

Bin

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] integrate function

2004-08-26 Thread Wayne Jones
I suggest that you check out the R package "odesolve" for solving this. 

However, from a more ecological standpoint (which I am guessing from the
fact that it is logistical growth) you might be interested in SOLVER.

You can find it at http://www.stams.strath.ac.uk/ecodyn/

Or indeed you might be interested in
http://www.stats.gla.ac.uk/~simon/simon/ddefit.html


Regards

Wayne Jones




-Original Message-
From: Ronaldo Reis Jr. [mailto:[EMAIL PROTECTED] 
Sent: 25 August 2004 21:02
To: R-Help
Subject: [R] integrate function

Is possible to integrate this diferential equation:

dN/dt = Nr(1-(N/K))

in R using the integrate() function?

Or any other diferential equation?

If yes, how?

If no, anybody know any software on linux that make this?

Inte
Ronaldo
-- 

O problema de ter os dois pés bem firmes no chão é que você não vai
conseguir 
tirar as calças.

--Anônimo
--
|>   // | \\   [***]
|   ( õ   õ )  [Ronaldo Reis Júnior]
|>  V  [UFV/DBA-Entomologia]
|/ \   [36571-000 Viçosa - MG  ]
|>  /(.''`.)\  [Fone: 31-3899-2532 ]
|  /(: :'  :)\ [EMAIL PROTECTED]]
|>/ (`. `'` ) \[ICQ#: 5692561 | LinuxUser#: 205366 ]
|( `-  )   [***]
|>>  _/   \_Powered by GNU/Debian Woody/Sarge

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] R-help

2004-08-25 Thread Wayne Jones


Or you could use: 


mat <- matrix(sample(1:25), 5, 5)
mat
which(mat==max(mat),arr.ind = T)


Wayne



-Original Message-
From: Jim Gustafsson [mailto:[EMAIL PROTECTED] 
Sent: 25 August 2004 10:07
To: [EMAIL PROTECTED]
Subject: [R] R-help


Dear R users,

I have just start working with R and would need some help.

If you have a matrix as:


   [,1][,2]   [,3]
[1,]   11   24   11
[2,]   16   29   16
[3,]215 2

and you want the position where you can find the maximum value, in this 
case row 2 and column 2.
How could you get the position?

The values in the matrix is likelihood function values, and  each row and 
column represent values from two parameters. So the idea is to seek which 
parameter values maximise the likelihood and therefore I need boot row and 
column position.

Regards Jim



--
This e-mail and any attachment may be confidential and may also be
privileged.
If you are not the intended recipient, please notify us immediately and then
delete this e-mail and any attachment without retaining copies or disclosing
the contents thereof to any other person.
Thank you.

--
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] How to select a whole column? Thanks!

2004-08-03 Thread Wayne Jones
What about: 

my.df<-data.frame(x=rnorm(20),y=rep(0,20),z=rep(1,20))


my.df[,!apply(my.df,2,sd)==0,drop=F]


This uses the fact that a column with eaqual values has a standard deviation
of 0. 



Regards

Wayne

-Original Message-
From: Jinsong Zhao [mailto:[EMAIL PROTECTED] 
Sent: 03 August 2004 09:43
To: R-Help
Subject: [R] How to select a whole column? Thanks! 

Dear all,

I hope to remove a whole column from a data frame or matrix (> 2000
columns). All value in the column are same. The first thing is to
select those columns. 

For instance, I hope to remove the V3~6 column, for all the value in
those colume is zero.

  V3 V4 V5 V6 V7 V8 V9V10
1  0  0  0  0  0.000  0.000  0.000  0.000
2  0  0  0  0  0.000  0.000  0.000  0.000
3  0  0  0  0  0.000  0.000  0.000  0.000
4  0  0  0  0  0.000  0.000  0.000  0.000
5  0  0  0  0  0.000  0.000  0.000  0.000
6  0  0  0  0 -0.001 -0.001 -0.001 -0.001
7  0  0  0  0  0.000  0.000  0.000 -0.001
8  0  0  0  0  0.000  0.000  0.000 -0.001
9  0  0  0  0 -0.009 -0.012 -0.015 -0.018

I mean how to select the first four columns.

Thank you very much for your consideration on this matter.

Best wishes,

Jinsong

=
(Mr.) Jinsong Zhao
Ph.D. Candidate
School of the Environment
Nanjing University
22 Hankou Road, Nanjing 210093
P.R. China
E-mail: [EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] computing sum of indicator variables

2004-07-26 Thread Wayne Jones
What about


x <- c(2,4,7)
out<-rep(0,max(x))
out[x]<-1


Regards

Wayne



-Original Message-
From: Stefan Böhringer [mailto:[EMAIL PROTECTED] 
Sent: 26 July 2004 09:46
To: R Help
Subject: [R] computing sum of indicator variables

My problem is as follows:
i is a list of integers of variable length. Now I want to compute a new
vector/array that contains 1's at the positions indicated in i. For
example:
c(2, 4) -> c(0, 1, 0, 1)

Using something like
i = i - c(0, i[2:length(i) - 1]);
sapply(i, function(x) c(rep(0, x - 1), 1)));

faces me with the problem of concatenating the result, which I could
somehow not find a solution for.

Thank you very much in advance.

Stefan

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Testing autocorrelation & heteroskedasticity of residuals in ts

2004-07-21 Thread Wayne Jones
Hi Vito, 
I would treat the residuals as a time series. You can fit an arima model to
the residuals. For example: 

data(nottem)
temp<-stl(nottem, "per")
my.arima<-arima(temp$time.series[,3], order=c(1,0,0), include.mean = FALSE) 
my.arima
tsdiag(my.arima)



If the ar1 term is significant then the residuals are auto-correlated. The
DW statistic is just another test for this. The command tsdiag gives
diagnostic plots for the arima model fit. 

In terms of heteroskedasticity, the Bruce-Pagan test from package lmtest
tests for variance changing as a function of another variable. I think
(although I am less sure) you can still use the test. 


To test whether your variance of residuals is monotonically increasing (or
maybe decreasing) over time I would use: 

library(lmtest)
Y<- as.numeric(temp$time.series[,3])
X<-1:nrow(temp$time.series)
bptest(Y~X)



Regards

Wayne



-Original Message-
From: Vito Ricci [mailto:[EMAIL PROTECTED] 
Sent: 21 July 2004 08:35
To: [EMAIL PROTECTED]
Subject: [R] Testing autocorrelation & heteroskedasticity of residuals in ts

Hi,

I'm dealing with time series. I usually use stl() to
estimate trend, stagionality and residuals. I test for
normality of residuals using shapiro.test(), but I
can't test for autocorrelation and heteroskedasticity.
Is there a way to perform Durbin-Watson test and
Breusch-Pagan test (or other simalar tests) for time
series?
I find dwtest() and bptest() in the package lmtest,
but it requieres an lm object, while I've a ts object.
Any help will be appreciated.
Best
Vito

=
Diventare costruttori di soluzioni

Visitate il portale http://www.modugno.it/
e in particolare la sezione su Palese
http://www.modugno.it/archivio/cat_palese.shtml

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] converting character strings to eval

2004-07-19 Thread Wayne Jones
Thanks folks, 

That's exactly what I needed. 
Thanks for the speedy replies. 

Regards

Wayne


-Original Message-
From: Dimitris Rizopoulos [mailto:[EMAIL PROTECTED] 
Sent: 19 July 2004 15:49
To: Wayne Jones
Cc: [EMAIL PROTECTED]
Subject: Re: [R] converting character strings to eval

Hi Wayne,

what you need is,

eval(parse(text=str))

I hope this helps.

Best,
Dimitris


Dimitris Rizopoulos
Doctoral Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/396887
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
 http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm


- Original Message - 
From: "Wayne Jones" <[EMAIL PROTECTED]>
To: "R-help" <[EMAIL PROTECTED]>
Sent: Monday, July 19, 2004 4:37 PM
Subject: [R] converting character strings to eval


>
> Hi there fellow R-users,
>
> I'm stuck on this seemingly trivial problem.
>
> All I want to coerce a character string into a command.
>
> For example:
>
> x<-rnorm(20)
> y<-rnorm(20)
> str<-"lm(y~x)"
>
> I want to evaluate the "str" command.
>
> I have tried
>
> eval(as.expression(str))
>
> But it doesn't seem to work.  I am aware of the call command, but
for
> reasons I won't go into I would prefer not to use it.
>
> Any help would be great.
>
> Regards,
> Wayne
>
>
>
>
>
> KSS Ltd
> Seventh Floor  St James's Buildings  79 Oxford Street  Manchester
M1 6SS  England
> Company Registration Number 2800886
> Tel: +44 (0) 161 228 0040 Fax: +44 (0) 161 236 6305
> mailto:[EMAIL PROTECTED] http://www.kssg.com
>
>
> The information in this Internet email is confidential and
m...{{dropped}}
>
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] converting character strings to eval

2004-07-19 Thread Wayne Jones

Hi there fellow R-users, 

I'm stuck on this seemingly trivial problem.

All I want to coerce a character string into a command. 

For example: 

x<-rnorm(20)
y<-rnorm(20)
str<-"lm(y~x)"

I want to evaluate the "str" command. 

I have tried 

eval(as.expression(str))

But it doesn't seem to work.  I am aware of the call command, but for
reasons I won't go into I would prefer not to use it. 

Any help would be great. 

Regards,
Wayne





KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] k nearest neighbor prediction

2004-07-08 Thread Wayne Jones
Hi there fellow R-users, 

Does anyone know if there is a package for k nearest neighbours prediction
as opposed to classification? I have found the package knncat but can't see
a way to adjust it to predict a continuous variable. 

Any help would be great, 

Regards

Wayne Jones



KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] k nearest neighbours

2004-06-22 Thread Wayne Jones

Hi there fellow R-users,

Does anyone know of a function which does exactly what knearneigh{spdep}
(finds the k nearest neighbours) does in the package spdep but for more than
2D data?

Regards

Wayne



KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] frequencies

2004-06-21 Thread Wayne Jones
See ?hist

For example 

hist(rnorm(100),plot=F,breaks=-3:3)$counts

Regards

Wayne

-Original Message-
From: Silvia Kirkman [mailto:[EMAIL PROTECTED] 
Sent: 21 June 2004 14:01
To: [EMAIL PROTECTED]
Subject: [R] frequencies

Hi

I have a set of fish lengths (cm) which I'd like to
have divided into bins as specified by myself. I want
to classify my bins as:

0<=x<0.5
0.5<=x<1
1<=x<1.5
1.5<=x<2
and so on...

I'd like the frequencies to be given as a vector
because I need to use these values for further
analysis.

Please can someone help me with this. I can't find a
command in R that allows one to do this.

Many thanks.

Silvia Kirkman

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Clustering Categorial and Continuous Variables

2004-06-10 Thread Wayne Jones

Hi there fellow R users, 

R has many different clustering packages (e.g. mclust,cluster,e1071).

However, can anyone recommend a method to deal with data sets that contain
categorial and continuous variables?

Regards

Wayne



KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] market-basket analysis in R

2004-06-09 Thread Wayne Jones


Hi there fellow R-users, 

Does anyone know if there exists a package for associated rules data mining
(market basket analysis) in R. 

I have tried searching CRAN but with no luck. 

Regards

Wayne


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Venn diagrams

2004-05-26 Thread Wayne Jones

Hello there, 

Does anyone know how to plot venn diagrams in R?
Ive searched the mail archive lists but to no avail. 

Regards, 

Wayne Jones


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] How does the lm() function work?

2004-05-07 Thread Wayne Jones
?step







-Original Message-
From: Phillip Good [mailto:[EMAIL PROTECTED]
Sent: 07 May 2004 15:19
To: [EMAIL PROTECTED]
Subject: [R] How does the lm() function work?


Does the lm() function use forward, backward, stepwise or some other method
of multivariable regression?  Where can I look up the details?

Phillip Good
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] loess and as.POSIXct

2004-05-07 Thread Wayne Jones
Hi there fellow R-users, 

I have just upgraded to R version 1.9.0 from R version 1.7.1 for Windows. 

Im trying to use the loess smoother where the X-variable is an as.POSIXct
variable.
The following works fine with R1.7.1 but not with R1.9.0.

Here is the example:


dates<-c('2003-08-03','2003-08-10','2003-08-17','2003-08-24','2003-08-31','2
003-09-07','2003-09-14','2003-09-21','2003-09-28','2003-10-05','2003-10-12',
'2003-10-19','2003-10-26','2003-11-02','2003-11-09','2003-11-16','2003-11-23
','2003-11-30','2003-12-07','2003-12-14','2003-12-21','2003-12-28','2004-01-
04','2004-01-11','2004-01-18','2004-01-25','2004-02-01','2004-02-08','2004-0
2-15','2004-02-22','2004-02-29','2004-03-07','2004-03-14','2004-03-21','2004
-03-28','2004-04-04','2004-04-11','2004-04-18','2004-04-25','2004-05-02')

length(dates)

strptime(dates,format="%Y-%m-%d")

length(strptime(dates,format="%Y-%m-%d"))

my.df<-data.frame(Sales=rnorm(40),Dates=as.POSIXct(strptime(dates,format="%Y
-%m-%d")))
my.df

loess(Sales~Dates,my.df)


I get the following error with version 1.9.0 
#Error: NA/NaN/Inf in foreign function call (arg 2)
#In addition: Warning messages: 
#1: longer object length
#is not a multiple of shorter object length in: cl == c("Date",
"POSIXct", "POSIXlt") 
#2: NAs introduced by coercion 

Can anyone help???



Dr Wayne R. Jones
Senior Statistician / Research Analyst
KSS Limited
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713




KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] lme correlation structure error

2004-04-22 Thread Wayne Jones

Hi there fellow R-users, 

I am trying to follow an example of modelling a serial correlation structure
in the textbook "Mixed Effects Model in S and Splus". 
However, I am getting some very odd results. Here is what I am trying to
run: 


library(nlme)
data(Ovary)
fm1<-lme(follicles~sin(2*pi*Time)+cos(2*pi*Time),data=Ovary,random=pdDiag(~s
in(2*pi*Time)))

### The example is fine up to here with all parameter estimates being
identical to that in the book. 


fm2<-update(fm1,correlation=corAR1())

 The parameters of fm2 are different to that in the book and 

plot(ACF(fm2))

# signifies that serial correlation still exists in the residuals.




## When I try and run this (which runs fine in the book)

fm5<-update(fm1,corr=corARMA(p=1,q=1))

 I get the following error message 

#Error in "coef<-.corARMA"(*tmp*, value = c(62.3428455941166,
62.3428517930051 : 
#   Coefficient matrix not invertible


I have tried running the example on R for windows versions 1.7.1 and 1.8.1
with the same results. 

Can anyone shed light on this?? Perhaps another R-user could kindly run this
example and see if they get the same results??

Kind regards,

Wayne


Dr Wayne R. Jones
Senior Statistician / Research Analyst
KSS Limited
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713




KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] GARCH

2004-04-02 Thread Wayne Jones
Hi there fellow R-Users, 

Can anyone recommend a good book on the theory and practice of applying
GARCH models. 

Also, does any one know of any R related subject material  in addition to
library(tseries).

Regards

Wayne

Dr Wayne R. Jones
Senior Statistician / Research Analyst
KSS Limited
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713




KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] stl and NA

2004-03-29 Thread Wayne Jones

Hi there, 

Does anyone know whether missing value (NA) handling has been implemented in
the time series decomposition method stl. No matter what I do I cannot get
stl to accpet NAs. 

I have looked in the archives and seen a similar posting
http://maths.newcastle.edu.au/~rking/R/help/03b/7092.html 
but have not seen any posted answers. 

Regards

Wayne



Dr Wayne R. Jones
Senior Statistician / Research Analyst
KSS Limited
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713




KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Problems with "optimize"

2004-03-29 Thread Wayne Jones
If indeed your error space is pitted with local minima then I suggest you
might try a method called 
bootstrap restarting to avoid these spurious local minimas. 

The paper was authored by Simon Wood and can be found here

http://www.stats.gla.ac.uk/~simon/simon/papers/bsfit.pdf





-Original Message-
From: Chiara Seghieri [mailto:[EMAIL PROTECTED]
Sent: 29 March 2004 10:27
To: [EMAIL PROTECTED]
Subject: [R] Problems with "optimize"


Dear All,

I'm trying to maximize a likelihood with respect one parameter using 
"optimize" on simulated data (without error component).
I've iterated the maximization procedure 1000 times and I should always 
obtain the same estimate of the parameter (equal to the simulated one) but, 
instead, i obtain different results (the likelihood function shouldn't be 
flat). Does anybody has experience with the optimize procedure?

Thanks in advance,

Chiara



Chiara Seghieri
Dipartimento di Scienze Statistiche "G.Parenti"
V.le Morgagni, 59
50134 Firenze, Italy
tel.: +39 055 4237230
fax: +39 055 4223560

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] regression problem

2004-03-26 Thread Wayne Jones

Consider a regression equation say:-

Y=a+b1*X1+b2*X2+b3*X3 

if all the regression coefficients have to sum to 0 
then 

a+b1+b2+b3=0

i.e. 

b3=-a-b1-b2

Substituting this back into the regression equation we get 


Y=a(1-X3)+b1(X1-X3)+b2(X2-X3)

All you need to do then is to create the new input variables say 

Z1=1-X3, Z2=X1-X3, Z3=X2-X3

so that 

Y=a*Z1+b1*Z2+b*Z3

You can parameterise a,b1 and b2 directly by fitting a linear model with no
intercept term 

you can then calculate b3 from b3=-a-b1-b2 

This example will generalize to an arbitrary number of parameters..


Regards

Wayne

-Original Message-
From: Patrick Burns [mailto:[EMAIL PROTECTED]
Sent: 26 March 2004 16:23
To: [EMAIL PROTECTED]; '[EMAIL PROTECTED]'
Subject: Re: [R] regression problem


Assuming that you want to estimate via least squares, you can
do something like this:

reg.coefsum <- function(x, y, start=coef(lm.fit(x, y)), coefsum=0, 
penalty=1000) {
subfun.objective <- function(coef){
sum((y - x %*% coef)^2) + abs(sum(coef)) * penalty
}
opt <- optim(start, subfun.objective, method='BFGS')
ans <- list(coefficients=opt$par)
ans
}

You can enhance the return value and make other improvements,
like check that the coefficient sum is accurate enough for you.

Patrick Burns

Burns Statistics
[EMAIL PROTECTED]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and "A Guide for the Unwilling S User")

[EMAIL PROTECTED] wrote:

>i need to know how to estimate a linear regression whose coefficients sum
>to zero
>
>__
>[EMAIL PROTECTED] mailing list
>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
>
>
>  
>

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886 
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] model fitting

2004-03-26 Thread Wayne Jones

What you need is a mixed effects model (lme) which is held in library(nlme).



I suggest you do some basic research on the web or check out Mixed-Effects
Models in S and S-Plus. 

Regards

Wayne




-Original Message-
From: J Fresen [mailto:[EMAIL PROTECTED]
Sent: 26 March 2004 06:47
To: [EMAIL PROTECTED]
Subject: [R] model fitting


I am trying to fit a normal linear model with response y and predictor x and
two factors sex and group.
I would like each combination of sex and group to have individual slopes and
then subsequently have parallel slopes.
I tried the model y ~ x*sex*group and it seemed to work for the first case..
Is this how it is supposed to be done?  For the second the model y ~ sex +
group seems to work.
 
In a similar vein I wish to fit a logistic model to a binary response "last"
is terms of two predictors, education and age, and factors "region", "ccm",
"ever", and "diss".  First allowing education and age to have different
slopes at all factor levels.  Secondly, to have parallel slopes at all
factor levels.  We wish to compare the models using AIC, BIC etc.  How do I
specify these models in R?
 
Help would be most appreciated.  I am a relatively new user.
 
John
 
Prof John Fresen (PhD)
Department of Mathematics and Statistics
Medical University of Southern Africa
PO Box 107
MEDUNSA
0204
South Africa
e-mail: [EMAIL PROTECTED]
tel: +27 12 521 4420
 

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Job Vacancy

2004-03-24 Thread Wayne Jones

www.kssg.com a pricing consulatancy based in Manchester (UK) are seeking an
experienced statistical analyst. 
Candidates must be eligible to work in the EU. If you are interested please
send an updated CV to [EMAIL PROTECTED] .


Company Overview

KSS is a leading provider of pricing and revenue management systems for the
Retail and Petroleum sectors. Our business applications help our clients get
more out of their existing pricing strategies, as well as improve the
efficiency and productivity of their pricing processes, enabling them to
achieve sustainable net profit improvements and increased market share. 

KSS' solutions are the result of many years of research into price
management and optimisation techniques, and can quantify the impact of
pricing and promotional activities on consumer demand, revenues and profit.
Using a deep understanding of consumer behaviour, clients can apply their
pricing policy and determine pricing and promotional campaigns that maximize
profit for given revenue goals - all within a carefully managed pricing
image. 

KSS' solutions have proven to deliver immediate and sustainable profit
improvements, and are implemented within a number of successful retail
companies throughout the world. 

With over 50% of the company engaged in research and development, we are
continually enhancing our products to meet the requirements of our
customers. Combined with our solid understanding of marketing and
merchandizing we deliver business solutions to enable our customers to meet
their strategic goals more profitably.

Job Description

We require an experienced statistician to join our existing research team of
statisticians and mathematical programmers.  

The work done by the research team is very varied and covers the entire
product life cycle from initial design through to deployment and customer
support. In addition to supporting product development we sometimes
undertake specific consultancy projects for retail clients. There is
considerable scope for tailoring the job description to suit a candidates
particular interests and preferences. It is likely to involve some or all of
the following: 

*   Mathematical modelling for product development team. This
involves enhancing current techniques or researching new ones for our
current or future business applications.

*   Provide statistical support to operations team during
product trials or deployment.  Typically work includes analysing pricing
data sets (price elasticity modelling) for retail and petroleum sectors.
Analyse feasibility and risks of applying particular techniques to a given
data set.

*   Lead, or assist with, statistical consultancy projects on
behalf of retail clients. Present results as a report or in person.



Desirable Skills and Experience

*   Good degree in Statistics or other maths related subject.
*   Postgraduate degree (MSc or PhD) would be an advantage.
*   Commercial experience within the pricing industry (although
not essential)
*   Previous experience within retail pricing would be very
valuable
*   At least two years experience in applying statistics to
'real' data. 
*   Strong analytical skills 
*   Team player
*   Experience in analysing and making inferences from complex
data sets.
*   Excellent communication and interpersonal skills.
*   Understanding of the issues involved in software
development.
*   Good presentation skills
*   Experience with SQL an advantage


Statistical Methods

The ideal candidate would have experience in the majority of the following
statistical methods: 

*   Statistical tools such as R, S-Plus or Matlab.
*   Forecasting techniques
*   Mixed effects models
*   Clustering techniques
*   Econometric models (price elasticity modelling)
*   Time series analysis
*   Regression analysis
*   Multivariate methods
*   Bayesian statistics/inference




Dr Wayne R. Jones
Senior Statistician / Research Analyst
KSS Limited
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713




KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] don't stop when error occurs

2004-03-18 Thread Wayne Jones
Look up ?try

Regards

Wayne

-Original Message-
From: pastaska1934 [mailto:[EMAIL PROTECTED]
Sent: 18 March 2004 14:36
To: [EMAIL PROTECTED]
Subject: [R] don't stop when error occurs


hi,
i'm doing some bootstraping on a data set, using kmeans for each bootstrap,
i mean i do a loop(200 times) and in each loop i use kmeans.
i have to count some occurences in a matrix result,
but somentimes kmeans fail, cause of the algorithm.
so i would like to avoid my function to stop on kmeans error
is there a way to do such a thing?
like
if(kmeans()=error)continue
or
if(kmeans != -1) go on

thanks

sebeuu^^

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] logistic regression with temporal correlation

2004-03-18 Thread Wayne Jones

Hello, 

You can either use nls and add weights see ?nls. 
Or use a generalized linear model and also change the weights. se ?glm

Regards

Wayne
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 18 March 2004 08:37
To: [EMAIL PROTECTED]
Subject: [R] logistic regression with temporal correlation


Hello

We would like to perform a logistic regression analysis weighting the
independent variable in  a temporal fashion, i.e. events occuring most
recent get highest weight. Does anyone know how to do this in R??

Regards
S. Merser and S. Lophaven

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886 
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] rate of change

2004-03-16 Thread Wayne Jones
?fdHess

Check out the function fdHess in the library(nlme). 

It numerically calculates the gradient and Hessian of a given function.

Regards

Wayne


-Original Message-
From: Fred J. [mailto:[EMAIL PROTECTED]
Sent: 16 March 2004 03:20
To: r help
Subject: [R] rate of change


Hello
I am wondering, how do I find if R has a certain
funciton to do a given task. do I just type
help.search("rate").
I am just trying to find a function to calculate the
rate of change for a variable. I could come up with
one if there isn't any allready builtin.

thanks

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] dsn

2004-03-08 Thread Wayne Jones
Hi 

If you are using windows then do this: 

Basically you need to add your oracle database as an ODBC data source. 

Control Panel -> Administrative tools  -> Data Sources (ODBC)

Select the System DSN tab and then Add. Select which type of Data source
i.e. Oracle database. Then follow the instructions.

Regards

Wayne



-Original Message-
From: Margarida Júlia Rodrigues Igreja [mailto:[EMAIL PROTECTED]
Sent: 01 March 1997 20:48
To: [EMAIL PROTECTED]
Subject: [R] dsn


Hi,

I have a data base in oracle and need to link R using ODBC.
When i use the command odbcConnect a dsn is needed.
I would like to create a dsn.Do you know how can i do it?
Thank you.

Margarida,Portugal

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] How to repeat a procedure

2004-02-18 Thread Wayne Jones
The command ?apply will easily get row means/vars (or col means/vars)

e.g.  
my.mat<-matrix(rnorm(144),12)
my.mat
apply(my.mat,1,mean,na.rm=T)
apply(my.mat,1,var,na.rm=T)



The functions ?rbind and ?cbind will help you add rows or columns to
matrices or data frames

Enjoy 

Wayne


-Original Message-
From: Haiyan Chen [mailto:[EMAIL PROTECTED]
Sent: 18 February 2004 15:39
To: [EMAIL PROTECTED]
Subject: [R] How to repeat a procedure


Hello,

1. After I generate a 100x50 matrix by x3<-matrix(0,100,50);for (i in
1:100) {x1<-rpois(50, mu[i]);x2<-x1; x2[runif(50)<.01]<-0; x3[i,]<-x2},

2. I want to calculate means and sample variances of each row and create a
new matrix 100x2;

3. I then want to repeat above procedure 500 times so that eventually I
will have 500 100x2 matrices.

Would someone mind helping me to code 2 & 3?

Thanks ahead of time.

Heyen

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Almost Ideal Demand System

2004-02-12 Thread Wayne Jones

Hi there fellow R users, 


Has anyone got an R example of applying an Ideal demand system, possibly
using the library systemfit??


Thanks 

Wayne


Dr Wayne R. Jones
Senior Statistician / Research Analyst
KSS Limited
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713




KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] R: lags

2004-02-10 Thread Wayne Jones
Try this for size: 

Not a very efficient way to do it though!!!


Get.Random.Walk<-function(){
length.walk<-1000

rand.walk<-rep(0,length.walk)

for(i in 2:length.walk)
{
rand.walk[i]<-rand.walk[i-1]+rnorm(1, mean=0, sd=1)

}
return(rand.walk)
}

plot(Get.Random.Walk())

-Original Message-
From: allan clark [mailto:[EMAIL PROTECTED]
Sent: 10 February 2004 14:48
To: Rhelp
Subject: [R] R: lags


hi all

how does one simulate a random walk process?

i.e

y(0)=0

y(t)=y(t-1)+ e(t)

where e(t) is normal(0,1)  say.

Regards
allan


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] R: lags and plots

2004-02-03 Thread Wayne Jones
?lag.plot

-Original Message-
From: allan clark [mailto:[EMAIL PROTECTED]
Sent: 03 February 2004 11:58
To: Rhelp
Subject: [R] R: lags and plots


Hi all

I want to calculate certain lags of a time series and plot them
simultaneously on a graph. can anyone help?




KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] r: lm question

2004-01-05 Thread Wayne Jones
lm(y~x-1)





-Original Message-
From: allan clark [mailto:[EMAIL PROTECTED]
Sent: 05 January 2004 09:31
To: [EMAIL PROTECTED]
Subject: [R] r: lm question


Hi all

this is a silly question since i should know the answer.

lm(y~x) perfroms linear regression with the intercept included.

How  do i estimate the equation without the intercept?

cheers

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Week of the Year date conversion

2003-12-15 Thread Wayne Jones

Hello there fellow R-users, 

I have received some data which comes in the following format: 

example1<-"200301"

The first 4 digits correspond to the year and the remaining 2 digits
correspond to the week of the year. 
I have tried to convert this to a date by using strptime as follows:

strptime(example1,format="%Y%U")

where U (looking up strptime) is the week of the year but it always returns
NA. 

ANy help in successfully converting this string format to a date would be
much appreciated

Regards

Wayne




Dr Wayne R. Jones
Senior Statistician / Research Analyst
KSS Limited
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713




KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] gls with serial correlation

2003-11-21 Thread Wayne Jones

Hello there fellow R users, 

Im trying to fit a gls model to data which has serial correlation in the
errors e(t)=p*e(t-1). 
However I dont seem to be having much luck in erradicating the
autocorrelation in the residuals. 

I have created the following example.

library(nlme)
x<-rnorm(100)
y<-3+2*x
y<-y+arima.sim(100,model=list(ar=(0.6)))+rnorm(100,0,0.2)
#Create a data set with first order serial correlation in the residuals.



my.mat<-as.data.frame(cbind(y,x))
acf(lm(y~x,my.mat)$residuals)  #fit a linear model and observe the
residuals.


acf(as.numeric(gls(y~x,my.mat,correlation = corAR1())$residuals));  # fit a
gls model with correlated error terms and observe autocorrelation of
residuals


Further more if I use time series fitting I get a different result. 


library(ts)
acf(arima(as.ts(y),xreg=x,order=c(1,0,0))$residuals) # fit a time series
model and observe the residuals


I must be doing something wrong. 

Am I using the correct correlation structure (corAr1).


Thanks in advance,

Wayne


Dr Wayne R. Jones
Senior Statistician / Research Analyst
KSS Limited
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713




KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Correction for first order autocorrelation in OLS residuals

2003-11-19 Thread Wayne Jones
Hi there fellow R-users, 

Can anyone tell me if there exits an R package that deals with serial
correlation in the residuals of an lm model.
Perhaps, using the Cochrane Orcutt or Praise Wilson methods?

Thanks, 

Wayne


Dr Wayne R. Jones
Senior Statistician / Research Analyst
KSS Limited
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713




KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R]: Prediction interval for a Gaussian family log-link model

2003-10-22 Thread Wayne Jones
Hi there fellow R-users, 

Can anyone tell me how to build  a prediction interval for a gaussian
log-link model for the reponse variable??
I can find the standard error of the predictions but I cant seem to find the
prediction interval. Is there a way I can calculate the 
prediction interval from the standard errors??

Here's the example: 

logX<-rnorm(100)
logY<--2-0.5*logX+rnorm(100,0,0.4)
Y<-exp(logY)
my.glm.mod<-glm(Y~logX,family=gaussian(link="log"))
predict(my.glm.mod,type="response",se.fit=TRUE)

Thanks,

Wayne


Dr Wayne R. Jones
Senior Statistician / Research Analyst
KSS Group plc
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713




KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Making R packages

2003-09-09 Thread Wayne Jones
The document http://www.stat.auckland.ac.nz/~kwan022/rinfo.php 
gives an excellent step by step description of how to make an R package for
Windows.

-Original Message-
From: Gattuso, Jean-Pierre [mailto:[EMAIL PROTECTED]
Sent: 09 September 2003 13:40
To: [EMAIL PROTECTED]
Subject: [R] Making R packages


Hi:

I am posting this message for a colleague who has 
a lot of trouble to build an R package on 
Windows. He did not find a solution to his 
problems on the R-help archives and hopes that 
one of the R gurus will be able to help.

He has a directory "CO2" which should contain all 
the required files and directories:
DATA:
DESCRIPTION
MAN:
R:
README
SRC:

The following command is run in a windows console:
C:\Program Files\R\rw1071\bin\rcmd INSTALL D:\CO2

Then he gets the following error (approximate 
translation of a French message) :
"Perl is not recognized as an internal or 
external command, an executable file or a command 
file"

Perl has of course been installed on the PC and 
my colleague has the "Tools" file. He does not 
know what is wrong although he suspects that 
environment variables (which ones?) must be 
changed.

Any help would be appreciated.

jp
-- 

Jean-Pierre Gattuso | mailto:[EMAIL PROTECTED] 
| http://www.obs-vlfr.fr/~gattuso

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Making R packages

2003-09-09 Thread Wayne Jones
Try adding C:\Perl\bin\; to your path variable.


-Original Message-
From: Gattuso, Jean-Pierre [mailto:[EMAIL PROTECTED]
Sent: 09 September 2003 13:40
To: [EMAIL PROTECTED]
Subject: [R] Making R packages


Hi:

I am posting this message for a colleague who has 
a lot of trouble to build an R package on 
Windows. He did not find a solution to his 
problems on the R-help archives and hopes that 
one of the R gurus will be able to help.

He has a directory "CO2" which should contain all 
the required files and directories:
DATA:
DESCRIPTION
MAN:
R:
README
SRC:

The following command is run in a windows console:
C:\Program Files\R\rw1071\bin\rcmd INSTALL D:\CO2

Then he gets the following error (approximate 
translation of a French message) :
"Perl is not recognized as an internal or 
external command, an executable file or a command 
file"

Perl has of course been installed on the PC and 
my colleague has the "Tools" file. He does not 
know what is wrong although he suspects that 
environment variables (which ones?) must be 
changed.

Any help would be appreciated.

jp
-- 

Jean-Pierre Gattuso | mailto:[EMAIL PROTECTED] 
| http://www.obs-vlfr.fr/~gattuso

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R]: RODBC column length>255

2003-09-08 Thread Wayne Jones
Hello there fellow R-users, 

I am using the RODBC functionality to query a database. I am trying to read
in a columns of strings which have a character field lengths greater than
255. 
The data.frame that I recieve back from the RODBC query only contains the
first 255 characters (the rest having been truncated). 

Any help on how to solve this problem would be greatly appreciated.

Reagrds
Wayne


Dr Wayne R. Jones
Statistician / Research Analyst
KSS Group plc
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713




KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R]: RODBC column length>255

2003-09-04 Thread Wayne Jones

Hello there fellow R-users, 

I am using the RODBC functionality to query a database. I am trying to read
in a columns of strings which have a character field lengths greater than
255. 
The data.frame that I recieve back from the RODBC query only contains the
first 255 characters (the rest having been truncated). 

Any help on how to solve this problem would be greatly appreciated.

Reagrds
Wayne


Dr Wayne R. Jones
Statistician / Research Analyst
KSS Group plc
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713




KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] FW: Creating a Package with Windows XP.

2003-09-02 Thread Wayne Jones
Thanks for that.

Ive moved everything into a new directory and the command: 

C:WayneTemp\rw1071\bin>Rcmd BUILD AnExample 

now works producing the file AnExample_1.0.tar.gz

However, the command C:WayneTemp\rw1071\bin>Rcmd check AnExample 
still produces the following error message: 

C:\Program Files\R\rw1071\bin>Rcmd check AnExample
* checking for working latex ...latex: not found
 NO
* using log directory 'C:/Program Files/R/rw1071/bin/AnExample.Rcheck'
* checking for file 'AnExample/DESCRIPTION' ... OK
* checking if this is a source package ... ERROR
Only *source* packages can be checked.


Any help would be much appreciated. 

Regards
Wayne



-Original Message-
From: Uwe Ligges [mailto:[EMAIL PROTECTED]
Sent: 02 September 2003 14:53
To: Wayne Jones
Cc: '[EMAIL PROTECTED]'
Subject: Re: [R] FW: Creating a Package with Windows XP.


Wayne Jones wrote:

>>Hi there fellow R-Users, 
>>
>>I am trying to use the "package.skeleton" to create my own package with
>>R.1.7.1 on Windows XP Professional.
>>I have followed the package.skeleton example and have downloaded the
>>necessary files found at http://www.stats.ox.ac.uk/pub/Rtools/tools.zip.
>>
>>and perl5, available via http://www.activestate.com/Products/ActivePerl/.
>>
>>When I run the command "Rcmd BUILD AnExample" I get the following output
>>and error message: 
>>
>>
>>C:\Program Files\R\rw1071\bin>Rcmd BUILD AnExample
>>* checking for file 'AnExample/DESCRIPTION' ... OK
>>* preparing 'AnExample':
>>* cleaning src
>>* checking whether 'INDEX' is up-to-date ... OK
>>* checking whether 'data/00Index' is up-to-date ... OK
>>* removing junk files
>>* building 'AnExample_1.0.tar.gz'
>>tar: Files/R/rw1071/bin/AnExample_1.0.tar: Cannot stat: No such file or
>>director
>>y
>>tar: Error exit delayed from previous errors
>>AnExample_1.0.tar: No such file or directory
>>

Do not use blanks in your paths ("Program Files").

Uwe Ligges


>>Whaen I run Rcmd check AnExample I get the following error message
>>
>>C:\Program Files\R\rw1071\bin>Rcmd check AnExample
>>* checking for working latex ...latex: not found
>> NO
>>* using log directory 'C:/Program Files/R/rw1071/bin/AnExample.Rcheck'
>>* checking for file 'AnExample/DESCRIPTION' ... OK
>>* checking if this is a source package ... ERROR
>>Only *source* packages can be checked.
>>
>>
>>What am I doing wrong??
>>Any help would be much appreciated, 
>>
>>Regards,
>>
>>Wayne
>>
>>
>>
>>
>>Dr Wayne R. Jones
>>Statistician / Research Analyst
>>KSS Group plc
>>St James's Buildings
>>79 Oxford Street
>>Manchester M1 6SS
>>Tel: +44(0)161 609 4084
>>Mob: +44(0)7810 523 713
>>
>>
> 
> 
> 
> KSS Ltd
> Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS
England
> Company Registration Number 2800886
> Tel: +44 (0) 161 228 0040 Fax: +44 (0) 161 236 6305
> mailto:[EMAIL PROTECTED]  http://www.kssg.com
> 
> 
> The information in this Internet email is confidential and m...{{dropped}}
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] FW: Creating a Package with Windows XP.

2003-09-02 Thread Wayne Jones
> Hi there fellow R-Users, 
> 
> I am trying to use the "package.skeleton" to create my own package with
> R.1.7.1 on Windows XP Professional.
> I have followed the package.skeleton example and have downloaded the
> necessary files found at http://www.stats.ox.ac.uk/pub/Rtools/tools.zip.
> 
> and perl5, available via http://www.activestate.com/Products/ActivePerl/.
> 
> When I run the command "Rcmd BUILD AnExample" I get the following output
> and error message: 
> 
> 
> C:\Program Files\R\rw1071\bin>Rcmd BUILD AnExample
> * checking for file 'AnExample/DESCRIPTION' ... OK
> * preparing 'AnExample':
> * cleaning src
> * checking whether 'INDEX' is up-to-date ... OK
> * checking whether 'data/00Index' is up-to-date ... OK
> * removing junk files
> * building 'AnExample_1.0.tar.gz'
> tar: Files/R/rw1071/bin/AnExample_1.0.tar: Cannot stat: No such file or
> director
> y
> tar: Error exit delayed from previous errors
> AnExample_1.0.tar: No such file or directory
> 
> 
> Whaen I run Rcmd check AnExample I get the following error message
> 
> C:\Program Files\R\rw1071\bin>Rcmd check AnExample
> * checking for working latex ...latex: not found
>  NO
> * using log directory 'C:/Program Files/R/rw1071/bin/AnExample.Rcheck'
> * checking for file 'AnExample/DESCRIPTION' ... OK
> * checking if this is a source package ... ERROR
> Only *source* packages can be checked.
> 
> 
> What am I doing wrong??
> Any help would be much appreciated, 
> 
> Regards,
> 
> Wayne
> 
> 
> 
> 
> Dr Wayne R. Jones
> Statistician / Research Analyst
> KSS Group plc
> St James's Buildings
> 79 Oxford Street
> Manchester M1 6SS
> Tel: +44(0)161 609 4084
> Mob: +44(0)7810 523 713
> 
> 


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R]: Creating a Package with Windows XP.

2003-09-02 Thread Wayne Jones


> Hi there fellow R-Users, 
> 
> I am trying to use the "package.skeleton" to create my own package with
> R.1.7.1 on Windows XP Professional.
> I have followed the package.skeleton example and have downloaded the
> necessary files found at http://www.stats.ox.ac.uk/pub/Rtools/tools.zip.
> 
> and perl5, available via http://www.activestate.com/Products/ActivePerl/.
> 
> When I run the command "Rcmd BUILD AnExample" I get the following output
> and error message: 
> 
> 
> C:\Program Files\R\rw1071\bin>Rcmd BUILD AnExample
> * checking for file 'AnExample/DESCRIPTION' ... OK
> * preparing 'AnExample':
> * cleaning src
> * checking whether 'INDEX' is up-to-date ... OK
> * checking whether 'data/00Index' is up-to-date ... OK
> * removing junk files
> * building 'AnExample_1.0.tar.gz'
> tar: Files/R/rw1071/bin/AnExample_1.0.tar: Cannot stat: No such file or
> director
> y
> tar: Error exit delayed from previous errors
> AnExample_1.0.tar: No such file or directory
> 
> 
> Whaen I run Rcmd check AnExample I get the following error message
> 
> C:\Program Files\R\rw1071\bin>Rcmd check AnExample
> * checking for working latex ...latex: not found
>  NO
> * using log directory 'C:/Program Files/R/rw1071/bin/AnExample.Rcheck'
> * checking for file 'AnExample/DESCRIPTION' ... OK
> * checking if this is a source package ... ERROR
> Only *source* packages can be checked.
> 
> 
> What am I doing wrong??
> Any help would be much appreciated, 
> 
> Regards,
> 
> Wayne
> 
> 
> 
> 
> Dr Wayne R. Jones
> Statistician / Research Analyst
> KSS Group plc
> St James's Buildings
> 79 Oxford Street
> Manchester M1 6SS
> Tel: +44(0)161 609 4084
> Mob: +44(0)7810 523 713
> 
> 


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] RODBC with Windows XP

2003-08-06 Thread Wayne Jones

Hi R-Users, 

I have very recently switched from using R on windows 2000 to windows XP
Professional. With XP I am having problems 
using the "odbcConnect("")" command. I can use the command perfectly well
until I close the database channel 
with the command "odbcClose(channel)".  When I try and re-establish
connection following the close command no dialog box appears 
and an error message is displayed. 

I am using version 1.6.2 of R.

The following is an example of this bewildering problem.


> library(RODBC)
> channel<-odbcConnect("")
> 
> channel
RODB Connection 0
Details:
  case=nochange
  DSN=Sheetz2
  UID=
  PWD=
  WSID=WS1223
  DATABASE=Sheetz2
  Trusted_Connection=Yes
> 
> 
> 
> odbcClose(channel)
> 
> channel<-odbcConnect("")
Warning messages: 
1: [RODBC] ERROR: state IM008, code 0, message [Microsoft][ODBC Driver
Manager] Dialog failed 
2: ODBC connection failed in: odbcDriverConnect(paste("DSN=", dsn, ";UID=",
uid, ";PWD=", pwd,  
> 


Any suggestions on how to fix this problem would be much appreciated. 

Regards,

Wayne






KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Sorting a data frame

2003-07-16 Thread Wayne Jones

Hi there R-Helpers, 

Does anyone know if it is possible to sort a dataframe?

I.e. Sort alphabetically column 1 ( which has some reocurring elements) then
sort alphabetically column2 but keeping the order of column 1 constant; 
much the same way that the sort function works in Excel.

Regards, 

Wayne


Dr Wayne R. Jones
Statistician / Research Analyst
KSS Group plc
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713



KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] rbind question

2003-07-08 Thread Wayne Jones
What about:  

>  matrix(rep(foo,2),ncol=length(foo),byrow=TRUE)



-Original Message-
From: David Andel [mailto:[EMAIL PROTECTED]
Sent: 08 July 2003 14:58
To: [EMAIL PROTECTED]
Subject: [R] rbind question


Hi

I am trying to replicate a vector in n rows for comparison purposes with 
another matrix.

foo <- c(1,2,3)
bar <- rbind(foo,foo) # does the trick for 2 rows
bar <- rbind(rep(foo,2)) # does something else

How do I generate a matrix with all rows=foo without writing 'foo' n times
as 
arg?

Thanks,
David

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


KSS Ltd
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and m...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] NA handling with time series objects

2003-04-04 Thread Wayne Jones
Hello All, 

Does anyone out there know a way to decompose time series objects with
missing values. 
A simple "na.omit" will not work since it does not preserve the time
differences between succesive observations. 

Thanks in advance, 

Wayne


KSS Ltd
A division of Knowledge Support Systems Group plc
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886 (Limited) 3449594 (plc)
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and may b... {{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Na handing with time series objects

2003-04-04 Thread Wayne Jones
Hello All, 

Does anyone out there know a way to decompose time series objects with
missing values. 
A simple "na.omit" will not work since it does not preserve the time
differences between succesive observations. 

Thanks in advance, 

Wayne



Dr Wayne R. Jones
Statistician / Research Analyst
KSS Group plc
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713



KSS Ltd
A division of Knowledge Support Systems Group plc
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886 (Limited) 3449594 (plc)
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and may b... {{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Na action with Lowess smoothing

2003-03-27 Thread Wayne Jones
Hi there, 

I cant seem to find a way for the lowess smoothing function to handle "NA"
values. 

Can anyone help??

Regards, 

Wayne


Dr Wayne R. Jones
Statistician / Research Analyst
KSS Group plc
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713



KSS Ltd
A division of Knowledge Support Systems Group plc
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886 (Limited) 3449594 (plc)
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and may b... {{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Integer manipulation

2003-03-21 Thread Wayne Jones
Hi there, 

When I enter a particularly long number into R it rounds it down into
scientific notation.
For example, 

> 251002679

[1] 2.51e+12

How can I preserve the precision of the original number?

Regards, 

Wayne



Dr Wayne R. Jones
Statistician / Research Analyst
KSS Group plc
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713



KSS Ltd
A division of Knowledge Support Systems Group plc
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886 (Limited) 3449594 (plc)
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and may b... [[dropped]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Moving average

2003-03-07 Thread Wayne Jones
Hi, 

Does anyone know if R has the functionality to calculate a simple moving
average. I cant seem 
to find it in the help menu. 

thanks, 

Wayne


Dr Wayne R. Jones
Statistician / Research Analyst
KSS Group plc
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713



KSS Ltd
A division of Knowledge Support Systems Group plc
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886 (Limited) 3449594 (plc)
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and may b... [[dropped]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] inserting an extra row into an array

2003-02-20 Thread Wayne Jones
Does anyone know a simple way to insert an extra row into a matrix or data
frame, thus increasing the dimensions. 


Wayne



KSS Ltd
A division of Knowledge Support Systems Group plc
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886 (Limited) 3449594 (plc)
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and may be legally privileged. 
It is intended solely for the addressee(s). Access to this Internet email by anyone 
else is unauthorised.

If you are not the intended recipient, any disclosure, copying, distribution or any 
action taken or omitted to be taken in reliance on it, is prohibited and may be 
unlawful. When addressed to our clients any opinions or advice contained in this 
Internet email are subject to the terms and conditions expressed in the governing 
engagement letter or contract.

This email message and any attached files have been scanned for the presence of 
computer viruses.  However you are advised that you open any attachments at your own 
risk.


[[alternate HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



[R] Numeric Coerceing

2003-02-14 Thread Wayne Jones
Does anyone know how to coerce a numeric to a string??

THanks

Wayne


KSS Ltd
A division of Knowledge Support Systems Group plc
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886 (Limited) 3449594 (plc)
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and may be legally privileged. 
It is intended solely for the addressee(s). Access to this Internet email by anyone 
else is unauthorised.

If you are not the intended recipient, any disclosure, copying, distribution or any 
action taken or omitted to be taken in reliance on it, is prohibited and may be 
unlawful. When addressed to our clients any opinions or advice contained in this 
Internet email are subject to the terms and conditions expressed in the governing 
engagement letter or contract.

This email message and any attached files have been scanned for the presence of 
computer viruses.  However you are advised that you open any attachments at your own 
risk.


[[alternate HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help



[R] RODBC

2003-02-13 Thread Wayne Jones
 
  I am using the new RODBC functionality to access a SQL database using
  sqlQuery(channel, query)  where "channel" gives the location of the
  database and "query" is a SQL
  string query to be passed to the database. 
  
  The problem occurs when I try and pass a SQL string which includes single
  quotes. When SQL parses the string it adds another single quote
  and the query becomes erroneous. However when we send the string from
 excel,
  everything is fine.
  
  Has anyone encountered this problem. Does anyone know of any alternatives
 to
  using single quotes.
  
  Thanks
  
  Wayne
  
Dr Wayne R. Jones
Statistician / Research Analyst
KSS Group plc
St James's Buildings
79 Oxford Street
Manchester M1 6SS
Tel: +44(0)161 609 4084
Mob: +44(0)7810 523 713



KSS Ltd
A division of Knowledge Support Systems Group plc
Seventh Floor  St James's Buildings  79 Oxford Street  Manchester  M1 6SS  England
Company Registration Number 2800886 (Limited) 3449594 (plc)
Tel: +44 (0) 161 228 0040   Fax: +44 (0) 161 236 6305
mailto:[EMAIL PROTECTED]http://www.kssg.com


The information in this Internet email is confidential and may be legally privileged. 
It is intended solely for the addressee(s). Access to this Internet email by anyone 
else is unauthorised.

If you are not the intended recipient, any disclosure, copying, distribution or any 
action taken or omitted to be taken in reliance on it, is prohibited and may be 
unlawful. When addressed to our clients any opinions or advice contained in this 
Internet email are subject to the terms and conditions expressed in the governing 
engagement letter or contract.

This email message and any attached files have been scanned for the presence of 
computer viruses.  However you are advised that you open any attachments at your own 
risk.


[[alternate HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help