Trying to use the syntax "pairs()" to see scatterplots of all visible pairs in a dataset consisting of 11 independent attributes.
however, an error shows up saying figure margins too large.
what to do, is there any other way to plot all the pairs without doing it individually??
hereby is the syntax being used.
pairs(mydata2.normal, pch=19, col=c("RED", "BLUE", "VIOLET", "GREEN"), cex= 0.6)
Hi, and welcome!
The error indicates that the desired plot won't fit within the constraints of the graphics window.
You can check your syntax with the help example:
pairs(iris[1:4], main = "Anderson's Iris Data -- 3 species",
pch = 21, bg = c("red", "green3", "blue")[unclass(iris$Species)])
Created on 2020-01-11 by the reprex package (v0.3.0)
By the way, the form of code example above, a reproducible example, called a reprex is very helpful in attracting answers. It wasn't strictly necessary for your problem, but is something to keep in mind.
pairs()
produces a matrix of scatterplots internally, but I don't know of anyway to selectively plot them in increments.
However, the GGally
package, may provide that ability. Here's an example of its ggpairs()
library(GGally)
#> Loading required package: ggplot2
#> Registered S3 method overwritten by 'GGally':
#> method from
#> +.gg ggplot2
data(tips, package = "reshape")
pm <- ggpairs(tips)
pm
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
Created on 2020-01-11 by the reprex package (v0.3.0)
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.