Description Usage Arguments Details Examples
Generic functions associated with the covarmat class.
1 2 3 4 5 6 7 |
x |
an object of class |
axes |
whether to add axes to the image plot of |
legend |
whether to add a legend to the image plot of |
col |
colour table used to plot the image |
n |
length of the continuous colour vector required |
... |
other arguments to be passed to lower-level functions, such as image. |
is.covarmat
returns a logical indicating whether the
object is a gpe covarmat
object and image.covarmat
provides
a nice plot of the values in the covariance matrix; in the style of, and
depending on image.plot
. palPuRd
uses the PuRd color
palette from RColorBrewer
to produce a non-divergent colour
palette for visualising these matrices.
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 |
# construct a kernel with one feature
k1 <- rbf('a')
# create a fake dataframe
df <- data.frame(a = sort(runif(50, -3, 3)))
# evaluate the kernel
K <- k1(df)
# is it a covarmat object?
is.covarmat(K)
# visualise it
image(K)
# create a new dataframe
df2 <- data.frame(a = sort(runif(100, -3, 3)))
# visualise the covariance matrix between the two dataframes
image(k1(df, df2))
# visualise the covariance matrix between these dataframes using
# the purple-red colour scheme (actually the default) but with fewer levels
image(k1(df, df2), col = palPuRd(10))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.