[R] (no subject)

2005-06-23 Thread Bernard L. Dillard
Hello Rers:

Let's say I have a column that looks like this:

Column
167.8
292.8
363.3
1.9
115.25

I want to manipulate the above data such that I only end up with this same
column but only with its decimals and not its whole numbers.  So the new
column would look like this (but the real column is VERY long):

Column
.8
.8
.3
.9
.25

Any suggestions about how I could do this?


-- 
Do all you can with what you have in the time you have in the place you are!

-Nkosi Johnson, 12-year old African hero

__
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] Contour Plots

2005-06-22 Thread Bernard L. Dillard
Hello all.

I'm confused a bit about contour plots.  After reading the help at
"?contour", it seems as though the contour plot is for 3D plots (x,y, and
z).  My data is in the form of grid coordinates (x,y), and I want to see a
contour plot of the data so that I can tell where most observations lie. 
My question is simple but still evasive.

Say my data is called places.  One column is X and another is Y.  Or,

  places$X  places$Y

Coordinate 1  32   50
Coordinate 2  15   33
Coordinate 3  28   20
etc

How do I get R to do the contour plot with no third "z" coordinate?

Thanks.

-- 
Do all you can with what you have in the time you have in the place you are!

-Nkosi Johnson, 12-year old African hero

__
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] Data Parsing

2005-06-20 Thread Bernard L. Dillard
Hello.  I have looked at R Site Search for this problem, and it didn't
give me exactly what I needed.

Consider this dataset called "results".  It has the following information:

Student  DaySubjectScore

Mary  1  Math  Failed
David 2  Science   Passed
Bob   4  Reading   Passed
Marie 4  Reading   Failed
Jesse 3  Spelling  Borderline
Et cetera


My goal is to only do analysis of the data having to do those who passed
or who are borderline.  I want to ignore all of the data having to do with
those who failed.  I think part of the syntax is something like
results[-c("Failed")], but I'm not getting anywhere with it.

How do I create a separate data set containing all information on students
who either passed or were borderline?

Thanks.

Bernard

-- 
Do all you can with what you have in the time you have in the place you are!

-Nkosi Johnson, 12-year old African hero

__
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] Moving average

2005-06-16 Thread Bernard L. Dillard
Good morning all!

I am attempting to superimpose a moving-average smoother onto a graph of
daily plots.  These plots (in table[,2] below) span about 350 days and
looks very noisy.  I'd like for this smoother to plot the average of each
group of 7 consecutive days (weekly) and show a line which joins these
series of averages.  Given the definition of MA, the first and last points
will generally overlap in the average calculation.

It's probably a one-liner, but I still am having some problems with the
syntax.  The only part I have correct is the "lines" statement to ensure
it overlays my original graph.

Here's the code I have thus far:

y <- table[,2]
plot(y,type="l",lty=3)
lines( ..)  {moving average code here to be placed here}

Any time series gurus out there?  Be gentle.  I'm an R beginner.

Thanx!

Bernard

__
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] Dateticks

2005-06-14 Thread Bernard L. Dillard
Hello.  I am having the worst time converting x-axis date ticks to real
dates.  I have tried several suggestions in online help tips and books to
no avail.

For example, the x-axis has 0, 50, 100, etc, and I want it to have
"6/17/03", "8/6/03" etc.  See attached (sample).

Can anybody help me with this.

Here's my code:

ts.plot(date.attackmode.table[,1], type="l", col="blue", lty=2,ylab="IED
 Attacks", lwd=2,xlab="Attack Dates",main="Daily Summary of Attack
 Mode")
grid()

Thanks for your help if possible.


sample.pdf
Description: Adobe PDF document
__
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