plot_scatterplot: Create scatterplot for all features

Description Usage Arguments Value See Also Examples

View source: R/plot_scatterplot.r

Description

This function creates scatterplot for all features fixing on a selected feature.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
plot_scatterplot(
  data,
  by,
  sampled_rows = nrow(data),
  geom_point_args = list(),
  scale_x = NULL,
  scale_y = NULL,
  title = NULL,
  ggtheme = theme_gray(),
  theme_config = list(),
  nrow = 3L,
  ncol = 3L,
  parallel = FALSE
)

Arguments

data

input data

by

feature name to be fixed at

sampled_rows

number of rows to sample if data has too many rows. Default is all rows, which means do not sample.

geom_point_args

a list of other arguments to geom_point

scale_x

scale of original x axis (before coord_flip). See scale_x_continuous for all options. Default is NULL.

scale_y

scale of original y axis (before coord_flip). See scale_y_continuous for all options. Default is NULL.

title

plot title

ggtheme

complete ggplot2 themes. The default is theme_gray.

theme_config

a list of configurations to be passed to theme.

nrow

number of rows per page

ncol

number of columns per page

parallel

enable parallel? Default is FALSE.

Value

invisibly return the named list of ggplot objects

See Also

geom_point

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
plot_scatterplot(iris, by = "Species")

# Plot skewed data on log scale
set.seed(1)
skew <- data.frame(replicate(5L, rbeta(1000, 1, 5000)))
plot_scatterplot(skew, by = "X5", ncol = 2L)
plot_scatterplot(skew, by = "X5", scale_x = "log10", scale_y = "log10", ncol = 2L)

## Not run: 
# Customize themes
library(ggplot2)
plot_scatterplot(
  data = mpg,
  by = "hwy",
  geom_point_args = list(size = 1L),
  theme_config = list("axis.text.x" = element_text(angle = 90)),
  ncol = 4L
)

## End(Not run)

boxuancui/eda documentation built on Dec. 9, 2020, 11:11 p.m.