ggally

Getting errors when plotting using ggpairs

爷,独闯天下 提交于 2019-12-11 20:15:36
问题 I have the following df: > str(merged) 'data.frame': 714 obs. of 6 variables: $ Date : Date, format: "2013-03-29" "2013-03-29" "2013-03-29" "2013-03-29" ... $ patch : Factor w/ 7 levels "BVG1","BVG11",..: 1 2 3 4 5 6 7 1 2 3 ... $ prod : num 2.93 2.77 2.86 2.87 3.01 ... $ workmix_pct: int 100 10 16 13 17 21 22 100 11 19 ... $ jobcounts : int 9480 968 1551 1267 1625 1946 2123 7328 810 1374 ... $ travel : num 30.7 34.3 33.8 29.1 28.1 24.9 34 31.8 32.7 36.4 ... > head(merged) Date patch prod

Error in GGally: Error in unit(tic_pos.c, “mm”) : 'x' and 'units' must have length > 0

假如想象 提交于 2019-12-11 04:03:11
问题 I'm trying to generate a plot for my dataset that can be found here There are 13 attributes with 13th attribute being the class. The first attribute is just ID so I want to ignore it. I try to create the graph like this but I'm getting an error > ggpairs(wine[2:13], columns=2:12, + colour='q', lower=list(continuous='points'), + axisLabels='none', + upper=list(continuous='blank')) Error in unit(tic_pos.c, "mm") : 'x' and 'units' must have length > 0 回答1: First of all you have the columns wrong

dplyr masks GGally and breaks ggparcoord

强颜欢笑 提交于 2019-12-09 15:44:26
问题 Given a fresh session, executing a small ggparcoord(.) example provided in the documentation of the function library(GGally) data(diamonds, package="ggplot2") diamonds.samp <- diamonds[sample(1:dim(diamonds)[1], 100), ] ggparcoord(data = diamonds.samp, columns = c(1, 5:10)) results into the following plot: Again, starting in a fresh session and executing the same script with the loaded dplyr library(GGally) library(dplyr) data(diamonds, package="ggplot2") diamonds.samp <- diamonds[sample(1

How to draw loess estimation in GGally using ggpairs?

自作多情 提交于 2019-12-08 08:13:04
问题 I tried GGally package a little bit. Especially the ggpairs function. However, I cannot figure out how to use loess instead of lm when plot smooth. Any ideas? Here is my code: require(GGally) diamonds.samp <- diamonds[sample(1:dim(diamonds)[1],200),] ggpairs(diamonds.samp[,c(1,5)], lower = list(continuous = "smooth"), params = c(method = "loess"), axisLabels = "show") Thanks! P.S. compare with the plotmatrix function, ggpairs is much much slower... As a result, most of the time, I just use

How to create lower density plot using your own density function in GGally

*爱你&永不变心* 提交于 2019-12-07 07:16:36
问题 With the following code: library(GGally) library(tidyverse) library(viridis) dat <- iris %>% select(-Species) my_fn <- function(data, mapping, ...){ # Using default ggplot density function p <- ggplot(data = data, mapping = mapping) + stat_density2d(aes(fill=..density..), geom="tile", contour = FALSE) + scale_fill_gradientn(colours=viridis::viridis(100, option="viridis")) p } ggpairs(dat, lower=list(continuous=my_fn)) + theme_void() I can create this plot: My question is how can I change the

Scattermatrix in ggplot2/GGally without density plots

旧城冷巷雨未停 提交于 2019-12-07 06:00:59
问题 I made a scattermatrix with the ggplot2 extension GGally with the following code ggscatmat(dat2, columns = 2:6, color="car", alpha=0.8) + ggtitle("Korrelation") + theme(axis.text.x = element_text(angle=-40, vjust=1, hjust=0, size=10)) Now my problem is that in this case I don't really need the density lineplot or the correlation coeff., I do only want the scatterplots in the matrix. Is there a way to "delete" the other facets? I can#T find anything in the documentation. Please excuse my bad

ggpairs: adjusting axis labels to show minimum and maximum only

十年热恋 提交于 2019-12-06 05:48:55
I want to show just the minimum and maximum values for all the axes of a ggpairs {GGally} plot. Find below a reproducible example df=as.data.frame(matrix(1:1000,nrow = 100)) ggpairs(df) I know I can do it individually by using breaks , but I don't know how can I apply this in ggpairs . Can somebody help me? 来源: https://stackoverflow.com/questions/45764317/ggpairs-adjusting-axis-labels-to-show-minimum-and-maximum-only

How to plot parallel coordinates with multiple categorical variables in R

自作多情 提交于 2019-12-05 19:13:43
问题 I am facing a difficulty while plotting a parallel coordinates plot using the ggparcoord from the GGally package. As there are two categorical variables, what I want to show in the visualisation is like the image below. I've found that in ggparcoord , groupColumn is only allowed to a single variable to group (colour) by, and surely I can use showPoints to mark the values on the axes, but i also need to vary the shape of these markers according to the categorical variables. Is there other

Scattermatrix in ggplot2/GGally without density plots

瘦欲@ 提交于 2019-12-05 11:25:00
I made a scattermatrix with the ggplot2 extension GGally with the following code ggscatmat(dat2, columns = 2:6, color="car", alpha=0.8) + ggtitle("Korrelation") + theme(axis.text.x = element_text(angle=-40, vjust=1, hjust=0, size=10)) Now my problem is that in this case I don't really need the density lineplot or the correlation coeff., I do only want the scatterplots in the matrix. Is there a way to "delete" the other facets? I can#T find anything in the documentation. Please excuse my bad english and thanks for any advice or help! Edit: I found a not yet perfect solution with ggpairs:

Legend using ggpairs

╄→гoц情女王★ 提交于 2019-12-05 06:53:59
问题 Trying to follow an example made here, I was reproducing the following code: # Load required packages require(GGally) # Load datasets data(state) df <- data.frame(state.x77, State = state.name, Abbrev = state.abb, Region = state.region, Division = state.division ) # Create scatterplot matrix p <- ggpairs(df, # Columns to include in the matrix columns = c(3,5,6,7), # What to include above diagonal # list(continuous = "points") to mirror # "blank" to turn off upper = "blank", legends=T, # What