Hi,
Take a look at ?par, all the arguments for the plot() function are
described there. Check in particular ylim, xlab and ylab
HTH,
Ivan
Le 9/16/2010 14:45, strampe a écrit :> Hello together,
>
> I am an absolute noob in R and therefore I need help urgently. I have
> received a script from my tutor with plot functions in it. However, I
can'
> manage to adapt these plots.
> The hole script is as follows:
>
>
>
> setwd("E:/")
> ##### (1) Read data ###
>
> dat<-
read.table("Komfort_Tatsaechliche_ID_Versuchsreihe_1.txt",
> header=TRUE,
> sep="\t", dec=",") #
tab-getrennte Textdatei
> names(dat)<- c("id", "resp", "amp")
> dat$id<- factor(dat$id) # kategoriale Variablen als Faktor
> definieren
> dat$amp<- as.numeric(gsub("^([0-9]),([0-9]+) Nm$",
"\\1.\\2", dat$amp))
>
> ##### (2) Explorative plots #####
>
> library(lattice)
> xyplot(resp ~ amp|id, dat,
type=c("g","p","smooth"))
>
> ##### (3) MIXED-EFFECTS REGRESSION MODELS #####
>
> library(nlme)
> lme1<- lme(resp ~ amp, dat, ~1|id, method="ML")
> lme2<- lme(resp ~ amp + I(amp^2), dat, ~1|id, method="ML")
> lme2a<- lme(resp ~ amp + I(amp^2), dat, ~amp|id, method="ML")
> lme3<- lme(resp ~ amp + I(amp^2) + I(amp^3), dat, ~1|id,
method="ML")
> lme5<- lme(resp ~ factor(amp), dat, ~1|id, method="ML")
>
> anova(lme1, lme2)
> anova(lme2, lme3, lme5)
>
> summary(lme2)
>
> ##### (4) observed vs. predicted data #####
>
> plot(augPred(lme2, ~amp, level=0:1))
>
> xvar<- seq(0, 0.4, len=50)
> plot(predict(lme2, data.frame(amp=xvar), level=0) ~ xvar,
type="l")
> # points() # adding mean
>
>
>
>
>
> I marked the important plot with boldface. I would like to adapt the Y axis
> on a value of -2 to +2.
>
> Moreover, I want to add the means of the the responses (resp) of each
> amp-value. My tutor already add a line "# points()" for this but
I'm not
> sure how to complement this line.
>
> And the last problem: How do I change the axis labels?
>
> I am glad about every constructive input.
> Please apologize my bad english.
>
> Strampe
>
--
Ivan CALANDRA
PhD Student
University of Hamburg
Biozentrum Grindel und Zoologisches Museum
Abt. Säugetiere
Martin-Luther-King-Platz 3
D-20146 Hamburg, GERMANY
+49(0)40 42838 6231
ivan.calandra@uni-hamburg.de
**********
http://www.for771.uni-bonn.de
http://webapp5.rrz.uni-hamburg.de/mammals/eng/mitarbeiter.php
[[alternative HTML version deleted]]