Description Usage Arguments Details Note Examples
A quick heatmap function for visualizing typical qdap dataframe/matrix outputs.
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | qheat(
mat,
low = "white",
high = "darkblue",
values = FALSE,
digits = 1,
text.size = 3,
text.color = "grey40",
xaxis.col = "black",
yaxis.col = "black",
order.by = NULL,
grid = "white",
by.column = TRUE,
auto.size = FALSE,
mat2 = NULL,
plot = TRUE,
facet.vars = NULL,
facet.flip = FALSE,
diag.na = FALSE,
diag.values = "",
...
)
## Default S3 method:
qheat(
mat,
low = "white",
high = "darkblue",
values = FALSE,
digits = 1,
text.size = 3,
text.color = "grey40",
xaxis.col = "black",
yaxis.col = "black",
order.by = NULL,
grid = "white",
by.column = TRUE,
auto.size = FALSE,
mat2 = NULL,
plot = TRUE,
facet.vars = NULL,
facet.flip = FALSE,
diag.na = FALSE,
diag.values = "",
...
)
## S3 method for class 'diversity'
qheat(
mat,
low = "white",
high = "darkblue",
values = FALSE,
digits = 1,
text.size = 3,
text.color = "grey40",
xaxis.col = "black",
yaxis.col = "black",
order.by = NULL,
grid = "white",
by.column = TRUE,
auto.size = FALSE,
mat2 = NULL,
plot = TRUE,
facet.vars = NULL,
facet.flip = FALSE,
diag.na = FALSE,
diag.values = "",
...
)
## S3 method for class 'termco'
qheat(
mat,
low = "white",
high = "darkblue",
values = FALSE,
digits = 1,
text.size = 3,
text.color = "grey40",
xaxis.col = "black",
yaxis.col = "black",
order.by = NULL,
grid = "white",
by.column = TRUE,
auto.size = FALSE,
mat2 = NULL,
plot = TRUE,
facet.vars = NULL,
facet.flip = FALSE,
diag.na = FALSE,
diag.values = "",
...
)
## S3 method for class 'word_stats'
qheat(
mat,
low = "white",
high = "darkblue",
values = FALSE,
digits = 1,
text.size = 3,
text.color = "grey40",
xaxis.col = "black",
yaxis.col = "black",
order.by = NULL,
grid = "white",
by.column = TRUE,
auto.size = FALSE,
mat2 = NULL,
plot = TRUE,
facet.vars = NULL,
facet.flip = FALSE,
diag.na = FALSE,
diag.values = "",
...
)
## S3 method for class 'character_table'
qheat(
mat,
low = "white",
high = "darkblue",
values = FALSE,
digits = 1,
text.size = 3,
text.color = "grey40",
xaxis.col = "black",
yaxis.col = "black",
order.by = NULL,
grid = "white",
by.column = TRUE,
auto.size = FALSE,
mat2 = NULL,
plot = TRUE,
facet.vars = NULL,
facet.flip = FALSE,
diag.na = FALSE,
diag.values = "",
...
)
## S3 method for class 'question_type'
qheat(
mat,
low = "white",
high = "darkblue",
values = FALSE,
digits = 1,
text.size = 3,
text.color = "grey40",
xaxis.col = "black",
yaxis.col = "black",
order.by = NULL,
grid = "white",
by.column = TRUE,
auto.size = FALSE,
mat2 = NULL,
plot = TRUE,
facet.vars = NULL,
facet.flip = FALSE,
diag.na = FALSE,
diag.values = "",
...
)
## S3 method for class 'pos_by'
qheat(
mat,
low = "white",
high = "darkblue",
values = FALSE,
digits = 1,
text.size = 3,
text.color = "grey40",
xaxis.col = "black",
yaxis.col = "black",
order.by = NULL,
grid = "white",
by.column = TRUE,
auto.size = FALSE,
mat2 = NULL,
plot = TRUE,
facet.vars = NULL,
facet.flip = FALSE,
diag.na = FALSE,
diag.values = "",
...
)
|
mat |
A matrix or dataframe produced by many qdap functions in
which the first column is the grouping variable and the rest of the matrix
is numeric. Also accepts objects directly from |
low |
The color to be used for lower values. |
high |
The color to be used for higher values. |
values |
logical. If |
digits |
The number of digits displayed if |
text.size |
A integer size to plot the text if |
text.color |
A character vector to plot the text if |
xaxis.col |
A single character vector color choice for the high values. |
yaxis.col |
A single character vector color choice for the low values. |
order.by |
An optional character vector of a variable name to order the
columns by. To reverse use a negative ( |
grid |
The color of the grid (Use |
by.column |
logical. If |
auto.size |
logical. If |
mat2 |
A second matrix equal in dimensions to |
plot |
logical. If |
facet.vars |
A character vector of 1 or 2 column names to facet by. |
facet.flip |
logical If |
diag.na |
logical. If |
diag.values |
The string to be used for the diagonal labels (values)
if |
... |
Not currently used. |
qheat
is useful for finding patterns and anomalies in large
qdap generated dataframes and matrices.
qheat
is a fast way of working with data formats
produced by qdap. The function isn't designed to be extended beyond
exploratory qdap usage.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
dat <- sentSplit(DATA, "state")
ws.ob <- with(dat, word_stats(state, list(sex, adult), tot=tot))
qheat(ws.ob)
qheat(ws.ob) + coord_flip()
qheat(ws.ob, order.by = "sptot",
xaxis.col = c("red", "black", "green", "blue"))
qheat(ws.ob, order.by = "sptot")
qheat(ws.ob, order.by = "-sptot")
qheat(ws.ob, values = TRUE)
qheat(ws.ob, values = TRUE, text.color = "red")
qheat(ws.ob, "yellow", "red", grid = FALSE)
qheat(mtcars, facet.vars = "cyl")
qheat(mtcars, facet.vars = c("gear", "cyl"))
qheat(t(mtcars), by.column=FALSE)
qheat(cor(mtcars), diag.na=TRUE, diag.value="", by.column=NULL, values = TRUE)
dat1 <- data.frame(G=LETTERS[1:5], matrix(rnorm(20), ncol = 4))
dat2 <- data.frame(matrix(LETTERS[1:25], ncol=5))
qheat(dat1, values=TRUE)
qheat(dat1, values=TRUE, mat2=dat2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.