powered by
Takes a numeric vector and maps it into a finite length sequence
round_to_seq(x, nlevels = 20, as_factor = FALSE)
A vector of length length(x) with values mapped to a sequence with nlevels unique valuess
length(x)
nlevels
A numeric or integer vector.
Integer scalar. Length of the sequence to be map onto.
Logical scalar. When TRUE the resulting vector is factor.
TRUE
Used in diffmap and plot_diffnet2
diffmap
plot_diffnet2
x <- rnorm(100) w <- data.frame(as.integer(round_to_seq(x, as_factor = TRUE)),x) plot(w,x)
Run the code above in your browser using DataLab