round_to_seq: Takes a numeric vector and maps it into a finite length...

Description Usage Arguments Value See Also Examples

View source: R/plot_diffnet2.R

Description

Takes a numeric vector and maps it into a finite length sequence

Usage

1
round_to_seq(x, nlevels = 20, as_factor = FALSE)

Arguments

x

A numeric or integer vector.

nlevels

Integer scalar. Length of the sequence to be map onto.

as_factor

Logical scalar. When TRUE the resulting vector is factor.

Value

A vector of length length(x) with values mapped to a sequence with nlevels unique valuess

See Also

Used in diffmap and plot_diffnet2

Examples

1
2
3
x <- rnorm(100)
w <- data.frame(as.integer(round_to_seq(x, as_factor = TRUE)),x)
plot(w,x)

netdiffuseR documentation built on May 29, 2017, 8:19 p.m.

Search within the netdiffuseR package
Search all R packages, documentation and source code