[R] tutors for time series....NYC

2006-09-16 Thread phil henshaw
I'm just getting started with R, having a lot of original work on
modeling and exploring the shapes of time series to transfer from a
graphic LISP environment.   Is there anyone in NYC that might be a good
tutor for me?
 

Phil Henshaw   .·´ ¯ `·.
~~~
680 Ft. Washington Ave 
NY NY 10040   
tel: 212-795-4844 
e-mail: [EMAIL PROTECTED]  
explorations: www.synapse9.com http://www.synapse9.com/ 
 

[[alternative HTML version deleted]]

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Grouping columns in a data frame based on the values of a column

2006-09-16 Thread John Kane

--- [EMAIL PROTECTED] wrote:

 Dear R users,
 
 This is a trivial question, there might even be an R
 function for it, but I have
 to do it many times and wonder if there is an
 efficient for it.
 
 
 Suppose we have a data frame like this:
 d - data.frame(x=sample(seq(0.1:1, by=0.01),
 size=100, replace=TRUE),
 y=rnorm(100, 0.2, 0.6))
 
 and want to have the average of y for a given
 interval of x, for example
 mean(y)[0x0.1]. Is there a simple way of doing
 this or I need to improvise?

I don't think so.  I don't think there is any value of
x  0.1 in the dataframe.

However if we change the data.frame to read
d - data.frame(x=sample(seq(0.01:1, by=0.01),
size=100, replace=TRUE),
y=rnorm(100, 0.2, 0.6))

dd - subset(d,  x 0  x  0.1)
mean(dd[,2])

seems to work.
or if you do this a lot you might want to write it as
a funtion.

sub.mean - function (frame, first.col, second.col,
upper, lower) {
dd - subset(frame,  first.col  lower  first.col 
upper)
mean(frame[,2])
}

sub.mean(d, 1,2,0.1,0)

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] dotplot/Dotplot: connecting points within factor level across time

2006-09-16 Thread Benjamin Tyner
For each level of the factor in dotplot, I have time points I'd like to 
connect with a line. In the example below, 'x' represents a starting 
time and 'd' a duration, and I wish to connect 'x' to 'x+d'. Ordinarily 
I would use Dotplot from hmisc for this, but I have not been able to 
find a time class that Dotplot will allow. I can get lattice dotplot to 
put the points up, but I've not figured out how to connect them. Any 
suggestions?

require(lattice)
z-data.frame(y=factor(letters),
  x=structure(1:26,class=c(POSIXt,POSIXct),tzone=),
  d=runif(26))

# this puts the points, but does not connect them
p-dotplot(y~x+I(x+d),
   data=z,
   scales=list(x=list(format=%M:%S))
   )

zh-z
zh$x-as.numeric(zh$x)
require(hmisc)
# this connects them, but at the expense of the time info
ph-Dotplot(y~Cbind(x,x,x+d),
data=zh,
pch= )



Thanks,
Ben

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] how to rescale the limits of yaxis rather than using the data range by default?

2006-09-16 Thread Wensui Liu
Dear Lister,

plot() is using the data range as the default limits of yaxis. Is
there any way I can change the limits? I just look at the help of
plot() and par() and couldn't find answers.

Thanks.


-- 
WenSui Liu
(http://spaces.msn.com/statcompute/blog)
Senior Decision Support Analyst
Health Policy and Clinical Effectiveness
Cincinnati Children Hospital Medical Center

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how to rescale the limits of yaxis rather than using the data range by default?

2006-09-16 Thread Wensui Liu
HI, Peter,

It is exactly what I want. Thank you so much!

wensui

On 9/16/06, Peter Konings [EMAIL PROTECTED] wrote:
 Hi,

 I'm not sure I understand your question correctly, but does the ylim option
 of plot do what you want?

 HTH
 Peter.


 On 9/16/06, Wensui Liu [EMAIL PROTECTED] wrote:
 
 Dear Lister,

 plot() is using the data range as the default limits of yaxis. Is
 there any way I can change the limits? I just look at the help of
 plot() and par() and couldn't find answers.

 Thanks.


 --
  WenSui Liu
 (http://spaces.msn.com/statcompute/blog)
 Senior Decision Support Analyst
 Health Policy and Clinical Effectiveness
 Cincinnati Children Hospital Medical Center

 __
 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
 and provide commented, minimal, self-contained, reproducible code.




-- 
WenSui Liu
(http://spaces.msn.com/statcompute/blog)
Senior Decision Support Analyst
Health Policy and Clinical Effectiveness
Cincinnati Children Hospital Medical Center

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how to rescale the limits of yaxis rather than using the data range by default?

2006-09-16 Thread David Barron
If you look at ?plot.default you should find that the way to do this is to
use the ylim argument.

On 16/09/06, Wensui Liu [EMAIL PROTECTED] wrote:

 Dear Lister,

 plot() is using the data range as the default limits of yaxis. Is
 there any way I can change the limits? I just look at the help of
 plot() and par() and couldn't find answers.

 Thanks.


 --
 WenSui Liu
 (http://spaces.msn.com/statcompute/blog)
 Senior Decision Support Analyst
 Health Policy and Clinical Effectiveness
 Cincinnati Children Hospital Medical Center

 __
 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
 and provide commented, minimal, self-contained, reproducible code.




-- 
=
David Barron
Said Business School
University of Oxford
Park End Street
Oxford OX1 1HP

[[alternative HTML version deleted]]

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] Error Message Documentation

2006-09-16 Thread cjkogan111

Hello,
I am new to R, and trying to work with it. I have a couple of quick
questions. First, I made a program and got the following error message.
--
Error in if (DatMdFile$Time.Value[NmRecord]  VBinTimesMinTop[NmCounter]) {
: 
missing value where TRUE/FALSE needed
In addition: Warning message:
 not meaningful for factors in: Ops.factor(DatMdFile$Time.Value[NmRecord],
VBinTimesMinTop[NmCounter]) 
-
I noticed that one of the values had decimal places, while the other didn't,
so the comparison would be 11.00  10
I don't know if that might have anything to do with my problem.
Anyway, I don't have much idea what the error means, and I don't know how to
check what data type the different vectors are.

I was wondering if anyone could help me out, and also, I was wondering if
there is any error documentation (stuff that tells what the error means.)

Thanks!
- cjkogan111
-- 
View this message in context: 
http://www.nabble.com/Error-Message-Documentation-tf2283899.html#a6344607
Sent from the R help forum at Nabble.com.

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] dotplot/Dotplot: connecting points within factor level across time

2006-09-16 Thread Gabor Grothendieck
Try this:

print(p)
trellis.focus(panel, 1, 1)
with(z, panel.segments(x, as.numeric(y), x+d, as.numeric(y)))
trellis.unfocus()

On 9/16/06, Benjamin Tyner [EMAIL PROTECTED] wrote:
 For each level of the factor in dotplot, I have time points I'd like to
 connect with a line. In the example below, 'x' represents a starting
 time and 'd' a duration, and I wish to connect 'x' to 'x+d'. Ordinarily
 I would use Dotplot from hmisc for this, but I have not been able to
 find a time class that Dotplot will allow. I can get lattice dotplot to
 put the points up, but I've not figured out how to connect them. Any
 suggestions?

 require(lattice)
 z-data.frame(y=factor(letters),
  x=structure(1:26,class=c(POSIXt,POSIXct),tzone=),
  d=runif(26))

 # this puts the points, but does not connect them
 p-dotplot(y~x+I(x+d),
   data=z,
   scales=list(x=list(format=%M:%S))
   )

 zh-z
 zh$x-as.numeric(zh$x)
 require(hmisc)
 # this connects them, but at the expense of the time info
 ph-Dotplot(y~Cbind(x,x,x+d),
data=zh,
pch= )



 Thanks,
 Ben

 __
 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
 and provide commented, minimal, self-contained, reproducible code.


__
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
and provide commented, minimal, self-contained, reproducible code.


[R] using table in R

2006-09-16 Thread Bingshan Li
Hi there,

I have a dataframe whose elements are numbers or
characters. I want to extract the frequencies of each
elements in the dataframe. For example,

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

What I want is first what are the elements in the data
(1,2,3 here) and second what are their frequencies
(1,1,2 respectively). How to use table to extract
these two pieces of information? I played with table
but couldn't extract the information. Please assume
that we do not know how many elements in the dataframe
a priori.

Thanks a lot!

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] using table in R

2006-09-16 Thread jim holtman
Here is one way; you create a vector of the data in the dataframe with
'unlist' and then use table:

 d = as.data.frame(matrix(c(1, 2, 3, 3), 2,2))
 d
  V1 V2
1  1  3
2  2  3
 table(unlist(d))

1 2 3
1 1 2



On 9/16/06, Bingshan Li [EMAIL PROTECTED] wrote:
 Hi there,

 I have a dataframe whose elements are numbers or
 characters. I want to extract the frequencies of each
 elements in the dataframe. For example,

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

 What I want is first what are the elements in the data
 (1,2,3 here) and second what are their frequencies
 (1,1,2 respectively). How to use table to extract
 these two pieces of information? I played with table
 but couldn't extract the information. Please assume
 that we do not know how many elements in the dataframe
 a priori.

 Thanks a lot!

 __
 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
 and provide commented, minimal, self-contained, reproducible code.



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

__
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
and provide commented, minimal, self-contained, reproducible code.


[R] Any other R users in Philadelphia?

2006-09-16 Thread Mitchell Maltenfort
I'm still new to R and wouldn't mind meeting other R users, at any
level of experience.

Regards,

Mitch Maltenfort
Thomas Jefferson University

-- 
I can answer any question.
I don't know is an answer.
I don't know yet is a better answer.

__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] using table in R

2006-09-16 Thread Bingshan Li
Hi Jim,

This is the way to get the frequencies. But what I
want is to store the elements in one vector and their
frequencies in another vector. My problem is that when
I call table to return the frequency table, I do not
know how to extract these two vectors. I tried
table(...)$dinnames and it did not work. It returned
NULL.

Thanks!


--- jim holtman [EMAIL PROTECTED] wrote:

 Here is one way; you create a vector of the data in
 the dataframe with
 'unlist' and then use table:
 
  d = as.data.frame(matrix(c(1, 2, 3, 3), 2,2))
  d
   V1 V2
 1  1  3
 2  2  3
  table(unlist(d))
 
 1 2 3
 1 1 2
 
 
 
 On 9/16/06, Bingshan Li [EMAIL PROTECTED]
 wrote:
  Hi there,
 
  I have a dataframe whose elements are numbers or
  characters. I want to extract the frequencies of
 each
  elements in the dataframe. For example,
 
  d = as.data.frame(matrix(c(1, 2, 3, 3), 2,2))
 
  What I want is first what are the elements in the
 data
  (1,2,3 here) and second what are their frequencies
  (1,1,2 respectively). How to use table to
 extract
  these two pieces of information? I played with
 table
  but couldn't extract the information. Please
 assume
  that we do not know how many elements in the
 dataframe
  a priori.
 
  Thanks a lot!
 
  __
  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
  and provide commented, minimal, self-contained,
 reproducible code.
 
 
 
 -- 
 Jim Holtman
 Cincinnati, OH
 +1 513 646 9390
 
 What is the problem you are trying to solve?


__
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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Periodogram of Schuster

2006-09-16 Thread Gabor Grothendieck
Check out:

http://cran.r-project.org/doc/contrib/Ricci-refcard-ts.pdf

On 9/15/06, Guillaume Blanchet [EMAIL PROTECTED] wrote:
 Dear All,

 Is there a function in R which can do a periodogram of Schuster ?

 Thanks in advance !

 Guillaume Blanchet

 __
 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
 and provide commented, minimal, self-contained, reproducible code.


__
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
and provide commented, minimal, self-contained, reproducible code.