Description Usage Arguments Value Examples
View source: R/plot_function.R
Plots a Heat Map of Near Repeat results based on p-values
1 2 3 4 5 6 7 |
knox_object |
a knox object, i.e. the result of a 'NearRepeat()' funtion call |
pvalue_range |
the range of p-values that will be colored as "significant", default = c(0, .05) |
text |
labels of cells, default is "knox_ratio". Possible values are "observed", "knox_ratio", "knox_ratio_median", "pvalues", or NA |
minimum_perc |
The minimum percentage of increased Knox value that will be highlighted. Default is 20 of Ratcliffe (2009). If parameter text equals "pvalues" or NA, the p-values alone determine highlighting, irrespective of the Knox (median) ratios. |
a heat map based on p-values (generated by ggplot2)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Generate example data. Suppose x and y refer to meters distance.
set.seed(10)
(mydata <- data.frame(x = sample(x = 20, size = 20, replace = TRUE) * 20,
y = sample(x = 20, size = 20, replace = TRUE) * 20,
date = as.Date(sort(sample(20, size = 20, replace = TRUE)),
origin = "2018-01-01")
))
# The plot() function can be used to plot a Heat Map of Near Repeat results based on p-values
set.seed(4622)
myoutput <- NearRepeat(x = mydata$x, y = mydata$y, time = mydata$date,
sds = c(0,100,200,300,400), td = c(0,1,2,3,4,5))
plot(myoutput)
# The default range of p-values that will be highlighted (0-.05) can be adjusted using
# the 'pvalue_range' parameter. By default the Knox ratios are printed in the cells,
# but this can be adjusted using the 'text' parameter. The default is "knox_ratio".
# Possible values are "observed", "knox_ratio", "knox_ratio_median", "pvalues", or NA.
# For more information, see vignette("NearRepeat")
plot(myoutput, pvalue_range = c(0, .1), text = "observed")
plot(myoutput, pvalue_range = c(0, .1), text = "pvalues")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.