all,
does anyone know how to place the abstract on top of Page 1 rather than on a
separate page? Help will be appreciated.
i hope that all of you are working on Gov 1000. ^0^
yongwook
-----------------------------
Yongwook Ryu
PhD Candidate
Department of Government
Harvard University
Tel:617-493-3397
Email: yryu(a)fas.harvard.edu
-----------------------------
In case any of you are trying to plot years in this
way, please note that the suggestion by Li doesn't
work.
Here are some recent emails that I have received.....
- Nirmala
--- Yuelin Li <yuelin(a)mail.med.upenn.edu> wrote:
> Date: Tue, 7 Jan 2003 09:32:34 -0500 (EST)
> From: Yuelin Li <yuelin(a)mail.med.upenn.edu>
> Subject: Re: [R] plot()
> To: ripley(a)stats.ox.ac.uk
> CC: n_ravishankar(a)yahoo.com
>
> Hi, Prof. Ripley,
>
> You are right, my example was wrong. I had thought
> that Nirmala
> wanted to plot the text. My mistake. Thanks,
>
> Yuelin Li.
>
> ----
>
> This is not going to work. There are five x
> values,
> irregularly spaced.
>
> On Mon, 6 Jan 2003, Yuelin Li wrote:
>
> > try text(c("1970", "1978", "1990"), x=1:3,
> y=1:3) after you
> first
> > call plot(c(1, 3), c(1, 3), axes=F, type="n",
> xlab="",
> ylab="")
> > to set the plotting area.
> >
> > Yuelin.
> >
> >
> > -- From: Nirmala Ravishankar
> <n_ravishankar(a)yahoo.com>
> > To: r-help(a)stat.math.ethz.ch
> > Subject: [R] plot()
> > Date: Mon, 6 Jan 2003 20:19:58 -0800 (PST)
> >
> > I am an R novice trying to figure out plot().
> > Specifically, I am trying to plot the values
> of a
> > numeric variable V for a set of years (1970,
> 1974,
> > 1976, 1978, 1980). How do I get R to label
> the years
> > I am plotting on the x-axis rather then some
> general
> > levels (1970, 1975, 1980.) Using
> as.character(year)
> > doesn't seem to help, and using
> as.factor(year)
> > generates steps insteads of dots.
> >
> > Help will be most appreciated. I have listed
> the code
> > I have been using below:
> >
> > > plot(y$year, y$V, type = "b")
> > > plot(as.character(y$year), y$V, type = "b")
> > > plot(as.character(y$year), y$V, type = "b")
> >
> >
> > Thanks,
> > NR
> >
> > ______________________________________________
> > R-help(a)stat.math.ethz.ch mailing list
> >
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help
> >
> > ______________________________________________
> > R-help(a)stat.math.ethz.ch mailing list
> >
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help
> >
>
> --
> Brian D. Ripley,
> ripley(a)stats.ox.ac.uk
> Professor of Applied Statistics,
> http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel: +44 1865
> 272861 (self)
> 1 South Parks Road, +44 1865
> 272866 (PA)
> Oxford OX1 3TG, UK Fax: +44 1865
> 272595
>
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
A perfectly fine, although off-topic, question for the list.
You should all feel free to send questions like this to the list
directly.
I don't know this literature at all.
Dave
--
David Kane
Lecturer in Government
617-563-0122
dkane(a)latte.harvard.edu
Stanislav Markus writes:
> Dear Command Crew,
>
> We were told to supply R code and Latex code along with our midterms, so
> that we could learn from each other - the codes, however, are not
> available.
Uhh. The code is available, I just looked at it for Pink
Panther. Alas, I can see that not every exam got posted. [Tao, do you
know what is up with that?]
If you mean that you want to have the code in text format so that you
can copy and paste it, then the answer to that request is No. You may
use the code, but you should not copy it verbatim (and you definately
need your own comments).
> Would it be possible to put R and Latex codes for top 7
> midterms online? This would certainly obviate a number of current
> questions on our part, and would be nice to have for future reference.
I couldn't aggree more (at least in terms of the pdf files).
Dave
> Best,
> Stan
>
--
David Kane
Lecturer in Government
617-563-0122
dkane(a)latte.harvard.edu
A good question for the list.
Nirmala Ravishankar writes:
> Dear Dave,
>
> I am trying to plot incumbency by year using plot() and two numeric
> variables year and psi. Using type = "b" gets R to generate all the dots
> and connect them with lines, but it refuses to label the x-axis
> accordingly (1970, 1972, 1974 etc.) Instead it has levels (1970, 1975,
> 1985 etc. I have tried using as.character(year), but that doesn't make
> any difference. I also tried as.factor(year) but that generates steps
> though it does label the years.
>
> Any ideas?
Nothing comes to mind.
However, you will often get better answers to your questions, both
from us and from public course like R-help, if you simplify your
question and make it easy for others to play with. See my postings to
R-help for examples. You want to send a few lines of R code that
someone can copy and paste to see what results you are getting. In
your case, you don't need to send real data, just some lines that
create fake dataframe with a "year" variable and so on.
Dave
> - Nirmala
>
>
>
--
David Kane
Lecturer in Government
617-563-0122
dkane(a)latte.harvard.edu
A fine question for the list.
Nirmala Ravishankar writes:
> Dear Dave,
>
> Welcome back. I hope you had a good vacation.
It was nice. One of my big successes in life, if you will permit a bit
of bragging, is that I have persuaded my family and my wife's family
to do holidays together. This causes occasional tension, especially in
the earlier years, but has worked out marvelously. I recommend it to
everyone.
Of course, I missed you all greatly.
;-)
> It would be very helpful if you could provide a rough guide to lattice.
Uhhh, I did. The article in R News is the best guide I know
of. Indeed, I don't know much about lattice beyond it.
> As you can tell by various messages posted to the list, a bunch of us are
> trying to figure out how it works, but with little success. Could you
> at least clarify how "panel" works. I was able to generate graphs for
> incumbency by state, but I cannot figure out how to add an abline.
Off hand, I don't know. Perhaps someone else does. Note that, as with
all tools, there will be somethings that R just won't do for you. So,
you need to do the best you can with what you have . . .
Dave
>
> Thanks,
> Nirmala
>
>
> On Sun, 5 Jan 2003, Dave Kane wrote:
>
> > As best I can tell, the answers for problem set 8 have not been
> > updated.
> >
> > Dave
> >
> > Nirmala Ravishankar writes:
> > > Ignore the last message. I figured out how to do a boxplot with lattice.
> > >
> > > Quick question: was problem set 8 ever updated to include the code for
> > > lattice graphics? I don't see it, but I could be looking at an older
> > > version.....
> > >
> > > - Nirmala
> > >
> >
> > --
> > David Kane
> > Lecturer in Government
> > 617-563-0122
> > dkane(a)latte.harvard.edu
> >
>
--
David Kane
Lecturer in Government
617-563-0122
dkane(a)latte.harvard.edu
Since we're obviously not getting a solution for the "lattice problem" and
everybody has better things to do, here are some tips for setting up lattice:
To start:
library(nlme)
lset(theme = col.whitebg())
Try out:
demo(lattice)
Basic functions and applications (I think there's more but this is what I've
figured out so far - use help() for details):
histogram(~x | y, data = blah) --> here, "y" needs to be coded as a character
variable. Then you get y numbers of graphs labeled properly. If you don't care
about the labels, "y" can be numeric.
xyplot(y ~ x | z, data = blah) --> same thing for "z" as above
cloud(y ~ x * z, data = blah) --> this creates a 3D plot. The variables don't
have to be characterized.
also potentially interesting:
levelplot()
densityplot()
"panel" and "group" are useful parameters, but I don't think I fully understand
the details...
Still haven't figured out how to put in the abline...
Best,
Phillip
ps - feel free to buy me a beer :)
-------------------------------------------------
Phillip Y. Lipscy
Perkins Hall Room #129
35 Oxford Street
Cambridge, MA 02138
(617)493-4893
lipscy(a)fas.harvard.edu
First Year Student, Ph.D. Program
Harvard University, FAS, Department of Government
-------------------------------------------------
A fine question for the list.
Ryan Thomas Moore writes:
> Teaching Team:
>
> I closed my final, and when I reopened it and restarted R in the same
> directory I was working in before, I typed ls(), and got character(0) in
> response. How do I find my previously loaded data and functions?
>
> When I open R in other directories, my previous data and functions are
> there...
Hmmm. My personal preference is to use "save" explicitly when trying
to save collections of data files. Of course, you can read all about
the default procedure by which R saves the workspace in "Introduction
to R".
Did you really save the workspace? Do you see an .Rdata file? Does
its time stamp look correct? We're you really in that directory? Be
careful of changing directories during a session (although this is
often helpful).
Dave
> Thanks,
> Ryan
>
> ------------------------------------------
> Ryan T. Moore ~ Government & Social Policy
> Ph.D. Candidate ~ Harvard University
>
--
David Kane
Lecturer in Government
617-563-0122
dkane(a)latte.harvard.edu