[R] apply and arrays

2005-07-24 Thread Laura Holt
Hi R!

I have a 3 dimensional array, which is 21 x 3 x 3

I want to use apply to sum on each 21x3 matrix, which is fine.

Is there a way that I can do this in 1 step instead of a loop (3), please?

thanks,
Laura Holt
mailto: [EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch 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] Off topic -2 Ln Lambda and Chi square

2005-07-11 Thread Laura Holt
Dear R :

Sorry for the off topic question, but does anyone know the reference for
the -2 Ln Lambda following a Chi Square distribution, please?

Possibly one of Bartlett's?

Thanks in advance!

Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch 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] O/T -2 Log Lambda and Chi Square

2005-07-10 Thread Laura Holt
Hi R People:

Sorry about the off topic question.  Does anyone know the reference
for "-2 Log Lambda  is approx dist. Chi square", please?

It may be Bartlett, but I'm not sure

thanks in advance!

Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch 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] Main Title for multiple charts

2005-07-07 Thread Laura Holt

Hi R !

I have the following set up:


par(mfrow=c(2,2))
curve(dexp,from=0,to=5)
hist(z1,main="Size 5")
hist(z2,main="Size 15")
hist(z3,main="Size 30")



I would like to put a title at the very top of the page that ties the theme 
of all the charts

together.  How would this be done, please?

Thanks in advance!

Laura Holt
mailto: [EMAIL PROTECTED]

_
Don’t just search. Find. Check out the new MSN Search!

__
R-help@stat.math.ethz.ch 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] where can i download the metrics package?

2005-06-29 Thread Laura Holt
There are several packages within rmetrics such as fSeries, fBasics, 
fExtremes, and so on.

You can download those in the usual way.


>From: Spencer Graves <[EMAIL PROTECTED]>
>To: ronggui <[EMAIL PROTECTED]>
>CC: R <[EMAIL PROTECTED]>
>Subject: Re: [R] where can i download the metrics package?
>Date: Tue, 28 Jun 2005 08:27:47 -0700
>
> How about "Rmetrics", listed under "misc:  related projects" on
>"www.r-project.org".
>
> spencer graves
>
>ronggui wrote:
>
> > i learn it from "metrics: Towards a package for doing econometrics in 
>R"but i can not find it in cran.
> >
> >
>
>--
>Spencer Graves, PhD
>Senior Development Engineer
>PDF Solutions, Inc.
>333 West San Carlos Street Suite 700
>San Jose, CA 95110, USA
>
>[EMAIL PROTECTED]
>www.pdf.com 
>Tel:  408-938-4420
>Fax: 408-280-7915
>
>__
>R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] question regarding new class

2005-05-31 Thread Laura Holt

Hi R people:

I have created a new class for a project that I am working on.  It works 
fine.


Just one question, please:  When I access the slots, is there any way that I 
could use

x$Name instead on [EMAIL PROTECTED], please?  Or is it that way by design, 
please?

Thanks.

Laura Holt

__
R-help@stat.math.ethz.ch 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] Power set

2005-05-26 Thread Laura Holt

Hi again!

I have a data.frame with the columns y, x1, x2, x3.

I would like to fit linear models with one variable at a time,
then 2 variables at a time, and then 3.

Makes me think of a power set.

Anyhow, is there a function to produce the right hand side of the formulas, 
please?


thanks,
Laura Holt
mailto: [EMAIL PROTECTED]
R Version 2.1.0 Windows

__
R-help@stat.math.ethz.ch 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] Returning from a function

2005-05-23 Thread Laura Holt

Hello again.

I have a function that plots a series and adds some interesting items to the 
plot.


Fair enough.

The last statement in the function is
return()

When the function is executed, NULL appears at the end, which is ok.
Is there any way to prevent NULL from appearing, or is that just as it 
should be, please?


thanks again,
Shamefacedly,
Laura Holt
R Version 2.1.0 Windows
mailto: [EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch 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] website reference for building R packages

2005-05-23 Thread Laura Holt

Hi R People:

A few weeks ago, someone put a link to a website for "how to" for building R 
packages.  It was very nice.


But of course, I have misplaced the link.  Does anyone still have that, 
please?


It was someone from the University of Chicago, I believe.

Thanks in advance.

Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch 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] lattice plots question

2005-05-18 Thread Laura Holt
Dear R People:
Is there any way to have the background of lattice plots be white instead of 
grey, please?

This is not a criticism by any means...the lattice stuff is UNbelievable!
Thanks,
Laura Holt
mailto: [EMAIL PROTECTED]
R Version 2.1.0 Windows
__
R-help@stat.math.ethz.ch 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][S] Data sets from Chambers' green book?

2005-05-10 Thread Laura Holt
Dear R and S people:
Yet another dorky question (YADQ), please:
Where can I find the data sets from Chambers' green book, please?
I've tried
http://cm.bell-labs.com/stat/Sbook
(web site, no data or even pointersfunctions and articles...good ones)
http://cm.bell-labs.com/stat/project/icmanuf
no web site at all.
Thanks in advance!
__
R-help@stat.math.ethz.ch 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] Classes and methods

2005-05-03 Thread Laura Holt
Hi R people:
I would like to learn about classes, methods, S3 and S4.
Which book would be the most helpful for this info, please:  the green one 
or the white(and blue) one?

Or is there something that would be even better, please?
Thanks in advance.
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
R 2.1.0 Windows.
trying to learn
__
R-help@stat.math.ethz.ch 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] Question about R initial message

2005-04-27 Thread Laura Holt
Dear R:
First of all, nothing is wrong!
I just had a question about the following"
"Natural language support but running in an English locale"
What does than mean, please?
Thanks in Advance
R 2.1.0 Windows
Laura Holt
mailto: [EMAIL PROTECTED]
__
R-help@stat.math.ethz.ch 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] Off topic excel question

2005-04-24 Thread Laura Holt
Does anyone know how to plot a time series in Excel, please?
Sorry for the Bad off topic.
thanks,
Laura Holt
mailto: [EMAIL PROTECTED]
__
R-help@stat.math.ethz.ch 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] writing to an Excel file

2005-04-10 Thread Laura Holt
Hi R!
Is there a special function that writes data to an Excel file, please?
I found read.spss and so on in the foreign library, but nothing to write.
Of course, writing to a regular data file and importing into Excel works 
fine, but I thought that there might be another way.

Thanks in advance.
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
R Version 2.0.1 Windows
__
R-help@stat.math.ethz.ch 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] read.table with header and text data

2005-04-06 Thread Laura Holt
Hi R!
I am reading in a text file which has one column of alpha data and 5 columns 
of numeric data.

There is a header row.
I would like the alpha data column to just be character rather than factor.
Is there a way to do this, please?  I'm thinking that it might be I() but 
can't figure out exactly how.

Thanks,
Laura
mailto: [EMAIL PROTECTED]
R 2.0.1 Windows
__
R-help@stat.math.ethz.ch 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] number formatting

2005-02-28 Thread Laura Holt
Dear R People:
I have used the command round(x,3) to produce values with 3 places to the 
right of the decimal.

Is there any command to remove the leading zero before the decimal point, 
please:  that is, if I have 0.375, how do I produce just .375, please?

Thanks in advance
R 2.0.1 for Windows
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
__
R-help@stat.math.ethz.ch 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] and [ESS] Starting ESS

2005-02-23 Thread Laura Holt
Dear R People:
I have finally seen the error of my ways and have decided to use ESS for R 
and S + stuff.

However, I have a question right from the beginning.  I'm somewhat confused 
by the installation instructions.

Do I install XEMACS or ESS first, please?
Windows XP
R Version 2.0.1
(S + 6.2)
Thanks so much!
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
__
R-help@stat.math.ethz.ch 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] Off Topic: GSL installation for Windows

2004-11-18 Thread Laura Holt
Hi R People!
Has anyone installed the Gnu Scientific Library on a Windows system, please?
I'm having a dreadful time with that.
Any advance would be much appreciated.
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
__
[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] changing character to a vector name

2004-11-16 Thread Laura Holt
Dear R People:
I would like to generate a vector/variable name from within a loop to be 
passed to a table
function.

This is what I have so far:
assign("p1",paste("raw3.df$",rw2$V1[3],sep=""))
p1
[1] "raw3.df$CITIZEN"

Essentially, I want to use the raw3.df$CITIZEN along with another value to 
generate a table.

However, I'm stuck here.  I know this is incredibly stupid.
Thanks in advance.
Sincerely
Laura Holt
mailto: [EMAIL PROTECTED]
__
[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] Changing zeros to NAs in a data frame

2004-11-16 Thread Laura Holt
Dear R People:
I have a data frame with some columns that are numeric and some which are 
factors.

There are zeros in the numeric columns and I would like to change them to 
NAs.  However, there are zeros in some of the factor columns, and I would 
like them to be left alone.

Is there a "global" way to do this, please?  I was thinking about use the 
results from "str" but am not sure.

R Version 2.0.0 Windows.
Thanks in advance.
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
__
[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][OT] Latex Integration question

2004-10-28 Thread Laura Holt
Hi R users!
I have a Latex Question:
When I use the following:
\begin{eqnarray*}
F(x) & = & -\lambda e^{-\lambda t} \mid_{0}^{x}
\end{eqnarray*}
the output looks ok.
But I would like the limits of integration line to be longer, if possible.  
Does anyone have any suggestions, please?

Thanks,
Laura Holt
mailto: [EMAIL PROTECTED]
__
[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] nlm question

2004-10-11 Thread Laura Holt
Dear R People:
I am trying to duplicate the example from Dennis and Schnabel's "Numerical 
Methods for Unconstrained Optimization and Nonlinear Equations", which 
starts on page 149.

My reason for doing so:  to try to understand the "nlm" function.
Here is the function:
mfun1
function(x) {
   z <- matrix(0,nrow=2,ncol=1)
   z[1,1] <- x[1]^2 + x[2]^2 - 2
   z[2,1] <- exp(x[1]-1) + x[2]^3 - 2
   res <- 0.5*t(z)%*%z
   res
}
This function has a root at c(1,1).
When I use the following:
nlm(mfun1,c(2,0.5))
$minimum
[1] 0.09168083
$estimate
[1]  1.485078e+00 -4.973395e-07
$gradient
[1] -8.120649e-09  1.096345e-09
$code
[1] 1
$iterations
[1] 19
I get the solution of 1.485078 and zero.
Now when I use:
nlm(mfun1,c(1.2,0.85))
$minimum
[1] 2.025965e-12
$estimate
[1] 1.01 0.99
$gradient
[1] 6.799786e-08 6.520232e-08
$code
[1] 1
$iterations
[1] 8

I get the appropriate answer.
What can I put into my code to improve the estimates, please?
Thanks
Sincerely,
Laura Holt
R Version 2.0.0
Windows
mailto: [EMAIL PROTECTED]
__
[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] please ignore question about nlm

2004-10-10 Thread Laura Holt
sorry for the previous message
an attack of the stupids.
Thanks,
Laura
__
[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] Puzzled on nlm

2004-10-10 Thread Laura Holt
Dear R People:
Here is a function to minimized:
mfun1
function(x,a) {
 x[1] <- a[1]*x[2] + a[3] - a[2]*(a[1]-a[2])*a[3]
 x[2] <- a[1]*x[1] - a[2]*a[3]
 return(x)
}
Here is my first try:
nlm(mfun1,c(1,1))
Error in f(x, ...) : Argument "a" is missing, with no default


nlm(mfun1,c(1,1),a=c(0.8,0.5,1))
Error in nlm(mfun1, c(1, 1), a = c(0.8, 0.5, 1)) :
   invalid function value in 'nlm' optimizer

I am stumped.  I'm sure that it's something really small that I'm 
overlooking.

Thanks in advance for any help.
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
__
[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] solution to outer question

2004-08-30 Thread Laura Holt
Hi again!
"pmax" works instead of max.
outer(x,y,function(x,y)12 - pmax(x,y))
 [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
[1,]   11   109876543 2 1
[2,]   10   109876543 2 1
[3,]999876543 2 1
[4,]888876543 2 1
[5,]777776543 2 1
[6,]666666543 2 1
[7,]555555543 2 1
[8,]444444443 2 1
[9,]333333333 2 1
[10,]222222222 2 1
[11,]111111111 1 1

All is well.
Sorry for the trouble.
Sincerely,
Laura H
mailto: [EMAIL PROTECTED]
__
[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] solution to outer question

2004-08-30 Thread Laura Holt
Hi again!
"pmax" works instead of max.
outer(x,y,function(x,y)12 - pmax(x,y))
 [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11]
[1,]   11   109876543 2 1
[2,]   10   109876543 2 1
[3,]999876543 2 1
[4,]888876543 2 1
[5,]777776543 2 1
[6,]666666543 2 1
[7,]555555543 2 1
[8,]444444443 2 1
[9,]333333333 2 1
[10,]222222222 2 1
[11,]111111111 1 1

All is well.
Sorry for the trouble.
Sincerely,
Laura H
mailto: [EMAIL PROTECTED]
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
__
[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] outer question

2004-08-30 Thread Laura Holt
Dear R People:
I need to construct a matrix of the order (pn-1) x (pn-1).
The elements can be constructed as
z[i,j] = pn - max(i,j)
for (i,j) in 1:(pn - 1)
I was messing with a toy example in which n=4, p=3 and tried to use outer:
x <- 1:11
y <- 1:11
outer(x,y,function(x,y)12-max(x,y))
Error in outer(x, y, function(x, y) 12 - max(x, y)) :
   dim<- : dims [product 121] do not match the length of object [1]

Is there a better way to do this, please?  I would like to avoid loops if 
possible.

Thanks in advance.
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
R version 1.9.1 windows
__
[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] more on apply on data frame

2004-08-20 Thread Laura Holt
Hi R People:
Several of you pointed out that using "tapply" on a data frame will work on 
the iris data frame.

I'm still having a problem.
The iris data frame has 150 rows, 5 variables.  The first 4 are numeric, 
while the last is a factor, which has the Species names.

I can use tapply for 1 variable at a time:
tapply(iris[,1],iris[,5],mean)
   setosa versicolor  virginica
5.006  5.936  6.588

but if I try to use this for all of the first 4, I get an error:
tapply(iris[,1:4],iris[,5],mean)
Error in tapply(iris[, 1:4], iris[, 5], mean) :
   arguments must have same length

Any ideas of what I'm doing wrong, please?
Thanks,
Laura Holt
mailto: [EMAIL PROTECTED]
R Version 1.9.1
Windows
__
[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] apply and data frames

2004-08-20 Thread Laura Holt
Whoops!
Just found it:
by(iris[,1:4],Species,mean)
Sorry for the inconvenience.
Laura.
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
__
[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] apply on a data frame

2004-08-20 Thread Laura Holt
Hi R People:
There are 2 data sets of the iris data: one is iris3, which is a 3-d array, 
and the other is iris, which
is a data frame with 150 rows and 6 variables.

Getting means is straightforward from the 3-day iris3 set:
apply(iris3,c(2,3),mean)
Setosa Versicolor Virginica
Sepal L.  5.006  5.936 6.588
Sepal W.  3.428  2.770 2.974
Petal L.  1.462  4.260 5.552
Petal W.  0.246  1.326 2.026

Is there is similar way to obtain those values from the iris data frame, 
please?

thanks in advance
R Version 1.9.1 Windows.
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
__
[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] legends on the outside of the "box"

2004-08-19 Thread Laura Holt
Hi R People:
Here is a simple set of commands:
x1 <- 1:10
x2 <- sqrt(x1)
plot(x1)
points(x2,col="red",pch=3)
legend(2,8,legend=c("First","Second"),col=c("black","red"),pch=c(1,3))
Fine.
Now, I would like to put the legend box on the outside of the plot itself, 
perhaps in the lower
left hand corner.

I've been messing with mtext, but to no avail.
Any help would be much appreciated.
R Version 1.9.1 Windows
Thanks,
Laura Holt
mailto: [EMAIL PROTECTED]
__
[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] ROracle and vector elements

2004-08-19 Thread Laura Holt
Hi there!
Is ROracle available for Windows, please?
I found a download site, but it's really for UNIX/Linux.
Here is a "thought question", please:  Why do the vector elements start at 
location 1 rather than zero, as C does?

Thanks in advance!
R Version 1.9.1 Windows
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
__
[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] Months on the horizontal axis

2004-08-16 Thread Laura Holt
Dear R People:
Just in case anyone is interested, here is a particular solution to the 
months on the horizontal axis question:

mon1
[1] "J" "F" "M" "A" "M" "J" "J" "A" "S" "O" "N" "D"
mon2 <- rep(mon1,2)
mon2
[1] "J" "F" "M" "A" "M" "J" "J" "A" "S" "O" "N" "D" "J" "F" "M" "A" "M" "J" 
"J"
[20] "A" "S" "O" "N" "D"
ya.ts
 Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
2001  3.7 -0.8  0.3 -1.5 -0.2 -0.4  2.5 -1.0 -1.2 -1.2  0.4 -0.5
2002  0.5  0.0 -0.8 -1.0  0.6  0.8 -0.5 -2.4  1.3  1.4 -0.1  0.5
mon1
[1] "J" "F" "M" "A" "M" "J" "J" "A" "S" "O" "N" "D"
mon2 <- rep(mon1,2)
mon2
[1] "J" "F" "M" "A" "M" "J" "J" "A" "S" "O" "N" "D" "J" "F" "M" "A" "M" "J" 
"J"
[20] "A" "S" "O" "N" "D"
#I looked at the original plot
plot(ya.ts)
#Now I start cleaning things up
plot(ya.ts,axes=F,ylab=" ",xlab="2001 - 2002",ylim=c(-3,4))
md1 <- ((0:23)/12)+2001
md1
[1] 2001.000 2001.083 2001.167 2001.250 2001.333 2001.417 2001.500 2001.583
[9] 2001.667 2001.750 2001.833 2001.917 2002.000 2002.083 2002.167 2002.250
[17] 2002.333 2002.417 2002.500 2002.583 2002.667 2002.750 2002.833 2002.917
axis(1,at=md1,labels=mon2,pos=-3)
axis(2,pos=2001)
title("Months on the Horizontal Axis")
Thanks for listening and thanks for the many kind responses.
Sincerely,
Laura
mailto: [EMAIL PROTECTED]
__
[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] ticks on the Time Axis

2004-08-16 Thread Laura Holt
Dear R People:
I have the following montly time series
ya.ts
 Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
2001  3.7 -0.8  0.3 -1.5 -0.2 -0.4  2.5 -1.0 -1.2 -1.2  0.4 -0.5
2002  0.5  0.0 -0.8 -1.0  0.6  0.8 -0.5 -2.4  1.3  1.4 -0.1  0.5
plot(ya.ts)
When the plot is constructed, the ticks on the horizontal (time) axis are 
2001.0, 2001.5, and so on.

Is there a way to set up ticks such as J,F,M,A,M..by months, please?
Thank you!
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
__
[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] str and Surv objects

2004-08-10 Thread Laura Holt
Dear R People:
I used the "Surv" function to produce the following object:
a <- Surv(1:4,2:5,c(0,1,1,0)) a
[1] (1,2+] (2,3 ] (3,4 ] (4,5+]
str(a)
Error in "[.Surv"(object, 1:ile) : subscript out of bounds

Why does str(a) give an error, please?  Or did I do something wrong?
Thanks in advance.
R Version 1.9.1 Windows
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
__
[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] hist and normal curve

2004-08-10 Thread Laura Holt
Hi R People:
I have a data set and I want to use the hist command and produce a 
histogram.
Then I want to superimpose a normal curve over the histogram.

Is there a simple way to do this, please?
R version 1.9.1 Windows.
thanks in advance,
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
__
[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] subsets in data frame

2004-07-13 Thread Laura Holt
Hello R People:
I have a data frame with 2 numeric variables and 1 factor.
There are 3 levels of the factor.
I would like to get sums/means/etc of the numeric variables with respect to 
the factor level.

I tried "table" and "subset" but have not hit upon a solution.
I thought maybe "apply" would be the answer but can't figure out how to 
break out by factor.

Any suggestions would be most appreciated.
Thanks yet again.
R Version 1.9.1 for windows
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
your life. http://lifeevents.msn.com
__
[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] question about seq.dates from chron vs. as.POSIXct

2004-07-07 Thread Laura Holt
Dear R People:
Here is an interesting question:
library(chron)
xt <- seq.dates(from="01/01/2004",by="days",length=5)
xt
[1] 01/01/04 01/02/04 01/03/04 01/04/04 01/05/04

#Fine so far
as.POSIXct(xt)
[1] "2003-12-31 18:00:00 Central Standard Time"
[2] "2004-01-01 18:00:00 Central Standard Time"
[3] "2004-01-02 18:00:00 Central Standard Time"
[4] "2004-01-03 18:00:00 Central Standard Time"
[5] "2004-01-04 18:00:00 Central Standard Time"

Why do the dates change, please?  Presumably the as.POSIXct is taking the xt 
as midnight GMT and converting to Central Standard Time.

Is the best solution to:
as.POSIXlt(xt, "CST")
[1] "2004-01-01 CST" "2004-01-02 CST" "2004-01-03 CST" "2004-01-04 CST"
[5] "2004-01-05 CST"

Thanks in advance!
Sincerely,
Laura Holt
who is corrupted by dates and times
mailto: [EMAIL PROTECTED]
download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/
__
[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] What precision is R

2004-07-05 Thread Laura Holt
Hello R People:
What precision is R, please?  64 bit?
Where would I find that out typically, please?
Thanks in advance!
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
FREE! http://join.msn.click-url.com/go/onm00200361ave/direct/01/
__
[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] [gently off topic] arima seasonal question

2004-07-01 Thread Laura Holt
Hello R People:
When using the arima function with the seasonal option, are the seasonal 
options only good for monthly and quarterly data, please?

Also, I believe that weekly and daily data are not appropriate for seasonal 
parm estimation via arima.

Is that correct, please?
Thanks,
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/
__
[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] abline and its objects

2004-06-29 Thread Laura Holt
Hi R People:
Is there a way to put an abline line for its objects on a plot, please?
I have an its object, ibm2, which runs from the January 2 through May 28.
ibm2
 ibm
2004-01-02  91.55
2004-01-05  93.05
2004-01-06  93.06
2004-01-07  92.78
2004-01-08  93.04
2004-01-09  91.21
2004-01-12  91.55
2004-01-13  89.70
2004-01-14  90.31
2004-01-15  94.02
.
.
.
I plot the data.  No Problem.
Now I extract the first day of the month in this fashion.
zi <- extractIts(ibm2,weekday=T,find="first",period="month")
zi
ibm
2004-01-02 91.55
2004-02-02 99.39
2004-03-01 97.04
2004-04-01 92.37
2004-05-03 88.02

Still ok.
I would like to put a vertical line at each of the zi values.
abline(v=zi,type="h",col=2)
lines(zi,type="h",col=2)
Nothing happens.
I tried creating another its object with NA in all but the zi places.  Then 
I used lines(test1)

Still nothing happened.
Any suggestions would be much appreciated.
R Version 1.9.1
Sincerely,
Laura H
mailto: [EMAIL PROTECTED]
Married. http://lifeevents.msn.com/category.aspx?cid=married
__
[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] removing NA from an its object

2004-06-29 Thread Laura Holt
Hi again!
I have the following its object:
class(x1)
[1] "its"
attr(,"package")
[1] "its"
x1
FTSE DAX
2004-06-07 4491.6 4017.81
2004-06-08 4504.8 4018.95
2004-06-09 4489.5 3997.76
2004-06-10 4486.1 4021.64
2004-06-11 4484.0 4014.56
2004-06-14 4433.2 3948.65
2004-06-15 4458.6 3987.30
2004-06-16 4491.1 4003.24
2004-06-17 4493.3 3985.46
2004-06-18 4505.8 3999.79
2004-06-21 4502.2 3989.31
2004-06-22 NA 3928.39
2004-06-23 NA 3945.10
2004-06-24 NA 4007.05
2004-06-25 NA 4013.35
2004-06-28 NA 4069.35
I want to create an its object with no NAs; that is, if there is an NA in 
any column, strike the entire row.

I did the following:
x2 <- its(na.omit(x1))
x2
FTSE DAX
2004-06-07 4491.6 4017.81
2004-06-08 4504.8 4018.95
2004-06-09 4489.5 3997.76
2004-06-10 4486.1 4021.64
2004-06-11 4484.0 4014.56
2004-06-14 4433.2 3948.65
2004-06-15 4458.6 3987.30
2004-06-16 4491.1 4003.24
2004-06-17 4493.3 3985.46
2004-06-18 4505.8 3999.79
2004-06-21 4502.2 3989.31
attr(,"na.action")
2004-06-22 2004-06-23 2004-06-24 2004-06-25 2004-06-28
   12 13 14 15 16
attr(,"class")
[1] "omit"
class(x2) <- "its"
My question:  is this the best way to accomplish the goal, please?  I tried 
apply with "all" and is.na but I got strange results.

Thanks.
R Version 1.9.1
Sincerely,
Laura
mailto: [EMAIL PROTECTED]
Married. http://lifeevents.msn.com/category.aspx?cid=married
__
[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] plotting with an its object

2004-06-28 Thread Laura Holt
Dear R People:
I have an its object.  The original its is the Dow Jones Industrial average 
from March 23, 1990 to March 23, 2000.  I did the following;

dj1 = original series
dj2 <- log(dj1)
ddj2 <- diff(dj2)
Ok so far.
Now I would like to plot this series with a certain y limit:
min(ddj2)
[1] -0.07454905
max(ddj2)
[1] 0.04860535
plot(ddj2,ylim=c(-0.1,0.1))
Error in plot.default(x, y, xaxt = "n", xlab = xlab, axes = axes, frame.plot 
= frame.plot,  :
   formal argument "ylim" matched by multiple actual arguments

What is wrong, please?
I checked the following:
   formal argument "ylim" matched by multiple actual arguments
?plot.its
Error in help("plot.its") : No documentation for `plot.its' in specified 
packages and libraries:
 you could try `help.search("plot.its")'
its.plot
Error: Object "its.plot" not found
?its.plot
Error in help("its.plot") : No documentation for `its.plot' in specified 
packages and libraries:
 you could try `help.search("its.plot")'

but to no avail.
R Version 1.9.1 for Windows
Thanks in advance for any suggestions.
Sincerely,
Laura
mailto: [EMAIL PROTECTED]
Guide! http://dollar.msn.com
__
[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 and forecasting

2004-06-23 Thread Laura Holt
Dear R People:
Is there a way to forecast with GARCH modeling as found in tseries, please?
When I use the predict command, I get an output of length 100, regardless of 
what I put in the n.ahead steps.

R Version 1.9.0
Thanks in advance.
Sincerely,
Laura
mailto: [EMAIL PROTECTED]
download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/
__
[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 and prediction

2004-06-22 Thread Laura Holt
Hi R People:
I used a garch object in the prediction command.  The original time series 
was 1000 entries long.

When I used:
predict(x.arch,n.ahead=2)
the output had 100 values.
I'm confused.
Does anyone have any suggestions, please?  Perhaps garch has its own special 
predict function.

Thanks,
Laura Holt
mailto: [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


[R] question about window and inserting value

2004-06-22 Thread Laura Holt
Hi again R People:
I have the following time series:
x.ts
  Jan   Feb   Mar   Apr   May   Jun   Jul   Aug   Sep
2000  0.95  0.66  0.83  0.66 -1.45 -1.25  0.33  1.03 -0.48
2001  2.55  1.21 -1.10 -0.63  0.01 -2.20 -0.51  1.12  1.11
2002 -1.37  0.55 -0.63 -0.56  0.92 -1.73  0.59  0.77  0.30
2003  0.55 -0.01 -0.54  2.27 -1.29 -0.23  0.09 -0.50 -0.61
  Oct   Nov   Dec
2000  0.84 -1.35  1.51
2001 -1.68  0.32 -0.97
2002 -1.74 -1.30  1.61
2003  0.25  0.66 -0.05
#For the March 2001 value:
window(x.ts,start=c(2001,3),end=c(2001,3))
 Mar
2001 -1.1
#Fine
window(x.ts,start=c(2001,3),end=c(2001,3)) <- 10
Error: couldn't find function "window<-"
#Doesn't work
Is there a good way to insert the value into the March 2001 location, 
please?
other than:
x.ts[15] <- 10

Thanks in advance!
R Version 1.9.0  for Windows
Sincerely,
Laura Holt
mailto: [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


[R] question about latex command in Hmisc

2004-06-21 Thread Laura Holt
Hi R People:
I got the following error from using the "latex" command from Hmisc;
latex(bbm)
'latex' is not recognized as an internal or external command,
operable program or batch file.
Warning message:
cmd execution failed with error code 1 in: shell(cmd, wait = TRUE, intern = 
output)

I was printing a matrix to a Latex File.  This worked fine in Version 1.8.
This is from Version 1.9.0 for Windows.
Any suggestions would be much appreciated.
Thanks in advance!
Sincerely,
Laura
mailto: [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


[R] time series object

2004-06-15 Thread Laura Holt
Hi R People:
I have a monthly time series x.ts which runs from 1/1995 through 12/2003.
x.ts <- ts(x,start=1995,freq=12)
str(x.ts)
Time-Series [1:108] from 1995 to 2004: -1.638 -0.236  0.830 -0.548  0.363 
...

My question: is there a way to print the observations from 1/1999 to 6/1999, 
please?
(other than x.ts[49:54])

Thank you in advance!
R version 1.9.0 for Windows
Sincerely,
Laura
mailto: [EMAIL PROTECTED]
a trip to NY
__
[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] question about Rcmd SHLIB

2004-06-11 Thread Laura Holt
Dear R People:
I'm trying to use the Rcmd SHLIB to produce a dll.
Rcmd SHLIB -o test2.dll test2.f
make[1]: *** [libR.a] Error 255
make: *** [libR] Error 2
Where do I go to find out about the "make" errors, please?
I suspect that I might be missing something.  I have the tools for creating 
new packages, but
maybe I left out something.

This is for R version 1.9.0 on Windows.
Thanks in advance,
Sincerely,
Laura
mailto: [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


[R] AR models

2004-06-07 Thread Laura Holt
Dear R People:
Is it possible to fit an AR model such as:
y_t = fee_1 y_t-1 + fee_2 y_t-9 + a_t,
please?
I know that we can fit an AR(9) model, but I was wondering if we could do a
partial as described.
Thank you for your help.
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
_
Watch the online reality show Mixed Messages with a friend and enter to win 
a trip to NY 
http://www.msnmessenger-download.click-url.com/go/onm00200497ave/direct/01/

__
[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] zipping a new package revisited

2004-05-30 Thread Laura Holt
In case you're wondering, here it is:
Rcmd build --binary --use-zip packname
Sorry that I didn't read the Writing R Extensions first.
Sincerely,
Laura
__
[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] zipping a new package

2004-05-30 Thread Laura Holt
Dear R People:
I have finally created a little R package.
Do I need to do anything special to create a zip file for that package, or 
just use Winzip, please?

thanks so much
R Windows Version 1.9.0
Thanks,
Laura
mailto: [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


[R] any simple examples for SJAVA please

2004-05-28 Thread Laura Holt
Hi!
Are there any simple examples for SJAVA please?
Thanks,
Laura
R Version 1.9.0 Windows
_
Is your PC infected? Get a FREE online computer virus scan from McAfee® 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

__
[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] Building packages and Rcmd check

2004-05-28 Thread Laura Holt
Hello yet again!
I'm trying to build a package.
The Rcmd build works fine.
But the Rcmd check produces an error because I don't have latex on my 
laptop.

Any suggestions, please?
R Windows 1.9.0
thanks again,
Laura
_
Learn to simplify your finances and your life in Streamline Your Life from 
MSN Money. http://special.msn.com/money/0405streamline.armx

__
[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] orca binary?

2004-05-27 Thread Laura Holt
Dear R People:
Is there a binary version for rorca, please?
Thanks,
Laura
mailto: [EMAIL PROTECTED]
R Windows 1.9.0
__
[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] modes of objects

2004-05-27 Thread Laura Holt
Hi R People:
I am looking for some objects:
objects(pat="f")
[1] "dufus"   "f"   "f1"  "fake.df" "ff"  "fm1" "one.df"  
"one1.df" "x.df""xf"
mode(objects(pat="f"))
[1] "character"

I would like to determine the mode of these objects.  For instance, dufus 
and f are functions, while fake.df and one.df are data frames.

I tried writing to a list, but still can't get it!
Thanks in advance!
Laura
mailto: [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


[R] socketConnection and readLines

2004-05-27 Thread Laura Holt
Dear R People:
I have tried the following code:
con <- socketConnection(port=13, host="tick.usno.navy.mil")
readLines(con)

The socketConnection function works, but the readLines command just sits.
This has happened on R for Windows 1.8.1 and 1.9.0 and R on LINUX 1.8.1
Any suggestions, please
Thanks,
Laura
mailto: [EMAIL PROTECTED]
_
Express yourself with the new version of MSN Messenger! Download today - 
it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

__
[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] SJava

2004-05-25 Thread Laura Holt
Hi again!
I'm trying to download SJava from the http://www.omegahat.org/RSJava/ 
website.

I'm trying to get the binary.
I download the version from BDR's website.
When I unzip the file via unzip.exe, the new folder appears as SJAVA (upper 
case).


library(SJava)
Error in library(SJava) : There is no package called 'SJava'
library(SJAVA)
Error in library(SJAVA) : There is no package called 'SJAVA'

Any suggestions, please?
TIA
Laura
mailto: [EMAIL PROTECTED]
_
Best Restaurant Giveaway Ever! Vote for your favorites for a chance to win 
$1 million! http://local.msn.com/special/giveaway.asp

__
[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] use of do.call and rep

2004-05-25 Thread Laura Holt
If I use this:
rep(1:2,c(5,5))
I'll get
1 1 1 1 1 2 2 2 2 2
Is there a way to do this more efficiently, please?
Maybe via do.call?
Thanks,
Laura
mailto: [EMAIL PROTECTED]
_
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
__
[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