I am trying to plot a scatterplot and box plot of two continuous varaibles but am getting an error that says,
Warning message: In par(fig = c(0, 0.8, 0.55, 1), new = TRUE) : calling par(new=TRUE) with no plot
The code worked when I simply replaced lines 4-6 of my code with:
plot(mydata$gre, mydata$gpa, xlab="GRE",ylab="GPA")
Here's my code:
mydata <- read.csv("http://www.ats.ucla.edu/stat/data/binary.csv")
par(fig=c(0,0.8,0,0.8), new=TRUE)
#plot(mydata$gre, mydata$gpa, xlab="GRE",ylab="GPA")
d<-ggplot(mydata,aes(x=mydata$gre, y=mydata$gpa))
d<-d+geom_line()
d
par(fig=c(0,0.8,0.55,1), new=TRUE)
boxplot(mydata$gre, horizontal=TRUE, axes=FALSE)
par(fig=c(0.65,1,0,0.8),new=TRUE)
boxplot(mydata$gpa, axes=FALSE)
mtext("Enhanced Scatterplot", side=3, outer=TRUE, line=-3)
Could you please shed some light on what I am doing wrong with regards to ggplot since R isn't recognizing it? What's really weird is that when I type d, the name of my ggplot, I get a plot...