Constructs a various tours of data space

randomPath(data, length = 10, reorder = TRUE, conditionvars = NULL, ...)

seqPath(data, length = 10, reorder = FALSE, conditionvars = NULL, ...)

alongPath(data, var, length = 10, current = NULL, ...)

Arguments

data

A dataframe

length

Path length, defaults to 10

reorder

If TRUE (default) uses DendSer to reorder the path dser

conditionvars

A vector of variable names. The returned tour is for this subset of variables.

...

ignored

var

A variable name for alongPath

current

Default value of variables for alongPath

Value

A dataframe with the path

Functions

  • randomPath(): Constructs a tour of data space following random observations

  • seqPath(): Constructs a tour of data space following first length observations

  • alongPath(): Constructs a tour of data space of length equi-spaced values in the range of var. If var is a factor, its levels are used.

Examples

randomPath(mtcars,length=5)
#>                    mpg cyl  disp  hp drat    wt  qsec vs am gear carb
#> Valiant           18.1   6 225.0 105 2.76 3.460 20.22  1  0    3    1
#> Merc 450SLC       15.2   8 275.8 180 3.07 3.780 18.00  0  0    3    3
#> Hornet Sportabout 18.7   8 360.0 175 3.15 3.440 17.02  0  0    3    2
#> Mazda RX4         21.0   6 160.0 110 3.90 2.620 16.46  0  1    4    4
#> Honda Civic       30.4   4  75.7  52 4.93 1.615 18.52  1  1    4    2
seqPath(mtcars,length=5)
#>                    mpg cyl disp  hp drat    wt  qsec vs am gear carb
#> Mazda RX4         21.0   6  160 110 3.90 2.620 16.46  0  1    4    4
#> Mazda RX4 Wag     21.0   6  160 110 3.90 2.875 17.02  0  1    4    4
#> Datsun 710        22.8   4  108  93 3.85 2.320 18.61  1  1    4    1
#> Hornet 4 Drive    21.4   6  258 110 3.08 3.215 19.44  1  0    3    1
#> Hornet Sportabout 18.7   8  360 175 3.15 3.440 17.02  0  0    3    2
alongPath(mtcars,var="mpg", length=5, current=mtcars[1,])
#>      mpg cyl disp  hp drat   wt  qsec vs am gear carb
#> 1 10.400   6  160 110  3.9 2.62 16.46  0  1    4    4
#> 2 16.275   6  160 110  3.9 2.62 16.46  0  1    4    4
#> 3 22.150   6  160 110  3.9 2.62 16.46  0  1    4    4
#> 4 28.025   6  160 110  3.9 2.62 16.46  0  1    4    4
#> 5 33.900   6  160 110  3.9 2.62 16.46  0  1    4    4