



Hello,

I am new to R and have a couple of questions. My data set contains the variables "Bwt" and "Hwt", which are bodyweight and heartweight, respectively, of a group of cats.
With the following code, I am making two plots, both to be viewed in the same plot window in R:

library(MASS)
 maleData <- subset(cats, Sex == "M")
 linreg0 <- lm(maleData$Hwt ~ maleData$Bwt)
 par(mfrow=c(1,2))
 plot(maleData$Hwt ~ maleData$Bwt)
 plot(rstandard(linreg0) ~ fitted(linreg0))

My problem is that the two plots end up all oblong and squashed, because the plot window doesn't have a size suited for having two plots next to one another. Can I tell R to adjust the plot window?

Also, I would like to do something along the lines of:

newData <- data.frame(Bwt = 3.5)
predict(linreg0,newData,interval="p")

This doesn't work - my guess is that to R, "Bwt" is not a variable in maleData, but maleData$Bwt is. I could use an attach command, but is it possible to get this to work without doing so?

Kind regards,
Rasmus Hedegaard. 		 	   		  
	[[alternative HTML version deleted]]

