> On 27 Nov 2017, at 11:56, Engin YILMAZ <ispanyol...@gmail.com> wrote: > > Dear > > I try to realize one scatter matrix which draws *one single variable to all > variables* with *regression line* . You can see my eviews version in the > annex . > > How can I draw this graph with R studio?
A tiny note; You do calculations in R not RSudio. RStudio is a tool (IDE) to use R in an easy way. The code below shows how to accomplish this task easily by ggplot. It’s adapted from [1]. library(ggplot2) library(reshape2) # This is your initial data.frame and you want scatterplots of all variables against x1. foo <- data.frame(x1 = runif(50, 0, 1), x2 = runif(50, 0, 1), x3 = runif(50, 0, 1), x4 = runif(50, 0, 1)) # melt data. This is very handy function from reshape2 library. foo2 <- melt(foo, "x1”) # plot points and add lm lines. ggplot(foo2, aes(value, x1)) + geom_point() + geom_smooth(method=lm) + facet_grid(.~variable) 1- https://stackoverflow.com/questions/24648729/plot-one-numeric-variable-against-n-numeric-variables-in-n-plots isezen ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.