lines3d: Add lines to a 3D scatterplot

Description Usage Arguments Value Note Examples

View source: R/scatterplot.R

Description

Add lines to a 3D scatterplot

Usage

1
lines3d(s, from, to, lwd = 1, alpha = 1, color)

Arguments

s

A scatterplot object returned by scatterplot3js.

from

A vector of integer indices of starting points.

to

A vector of integer indices of ending points of the same length as from.

lwd

A single numeric value of line width (applies to all lines).

alpha

A single numeric value of line alpha (applies to all lines).

color

Either a single color value or vector of values as long as from of line colors; line colors default to interpolating their vertex point colors.

Value

A new scatterplot htmlwidget object.

Note

This function replaces the old points3d approach used by scatterplot3d.

Examples

1
2
3
4
5
6
7
8
## Not run: 
 x <- rnorm(5)
 y <- rnorm(5)
 z <- rnorm(5)
 scatterplot3js(x, y, z, pch="@", color=rainbow(5)) %>%
   lines3d(c(1, 2), c(3, 4), lwd=2)

## End(Not run)

Example output

Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

threejs documentation built on Jan. 21, 2020, 5:07 p.m.