calc_web: Title

Description Usage Arguments Value Examples

View source: R/web.R

Description

Title

Usage

1
calc_web(mydf)

Arguments

mydf

A data frame. The first column holds the names for the 'web' data. The remaining columns are the names of the 'spokes'.

Value

A data.frame in 'long' format with columns 'group', 'x', and 'y' where group holds the names of the 'web' data groups, with 'x' and 'y' representing points on each spoke, with each group having number of rows = number of spokes plus one (the first one repeats at the end so that plot lines will connect).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Not run: 
df <- data.frame(
  nm = c(
    "A", "B", "C",
    "A", "B", "C",
    "A", "B", "C",
    "A", "B", "C",
    "A", "B", "C"
  ),
  spk = c(
    "P1", "P1", "P1",
    "P2", "P2", "P2",
    "P3", "P3", "P3",
    "P4", "P4", "P4",
    "P5", "P5", "P5"
  ),
  value = c(
    .1, .2, .3,
    .4, .5, .6,
    .7, .8, .9,
    .10, .11, .12,
    .13, .14, .15
  )
)
ds <- tidyr::spread(df, key = "spk", value = "value")
web <- calc_web(ds)

## End(Not run)

pbs-assess/ggspider documentation built on Dec. 29, 2020, 6:07 a.m.