Johannes,

This will get you started

tmp <- data.frame(x=rnorm(10), y=rnorm(10, 1000, 100), txt=letters[1:10])
plot(y ~ x, data=tmp)
text(x=tmp$x+.05, y=tmp$y-20, labels=tmp$txt)
rect(tmp$x-.05, tmp$y-25, tmp$x+.1, tmp$y-10)

Rich


You will probably need to use the xlim and ylim arguments on the plot
function call.
You will need to experiment with the constant adjustments on the text
and rect calls.  You might need vector adjustments rather than scalars on
those calls.

On Sat, Nov 24, 2012 at 11:04 AM, john55 <johannesm67@gmail.com> wrote:

> Hi everyone,
>
> i´m trying to graphically display distributions with r and i´m working with
> makrodata from the WVS.
>
> the command i´m using is
>
> > plot (Makrodata$v11, Makrodata$v12, xlab="Democracy Score Economist",
> > ylab= share religious people")
>
>
> i´m having an additional variable that identifies respectively labels the
> cases with its country name.
> how can i implement that variable, so it identifies the various cases in
> the
> scatterplot and looks like the spss screenshot i posted below?
>
> <http://r.789695.n4.nabble.com/file/n4650650/Unbenannt.gif>
>
> thanks in advance!
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/How-to-Label-Cases-in-Scatterplots-tp4650650.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help@r-project.org 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.
>

	[[alternative HTML version deleted]]


