diff --git a/NEWS.md b/NEWS.md
index cfbfe6b..d19b74f 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,9 @@
# visibly 0.2
+## visibly 0.2.5
+
+* Add plot_gam_3d.
+
## visibly 0.2.4
* Add corr_heat.
diff --git a/R/corr_heat.R b/R/corr_heat.R
index 1183aa5..868eaab 100644
--- a/R/corr_heat.R
+++ b/R/corr_heat.R
@@ -242,7 +242,8 @@ corr_heat <- function(cormat,
theme_plotly()
# plotly gives a warning it can't do limits, then does them; this appears
- # the only way to suppress
+ # the only way to suppress, but then won't work for Rmd html output; see
+ # issue #1202
suppressWarnings({ print(p) })
} else {
diff --git a/README.Rmd b/README.Rmd
index 19e40ec..a6a4ee4 100644
--- a/README.Rmd
+++ b/README.Rmd
@@ -62,23 +62,9 @@ Plot it to get a feel for things.
create_palette('#ff5500', plot = T)
```
-There are some other options to express.
-
-```{r plot2}
-create_palette('#ff5500',
- alpha = .5,
- plot = T,
- name = 'orange_you_glad_you_have_this_color')
-```
-
-
One of the built-in palettes is based on R's blue. Others are based on [Stan's](https://github.com/stan-dev/stan) red, [plotly's](https://github.com/ropensci/plotly) base colors, and the red-blue palette from [RColorBrewer](https://github.com/cran/RColorBrewer/blob/master/R/ColorBrewer.R).
-```{r rblue}
-palettes$Rblue
-```
-
A clean theme for plotly.
```{r example4}
@@ -89,14 +75,18 @@ mtcars %>%
theme_plotly()
```
-Visualize a correlation matrix.
+Visualize a correlation matrix via factor analysis.
-```{r corrheat1}
+```{r corrheat1, eval=FALSE}
data('bfi', package = 'visibly')
cor_matrix = cor(bfi, use='pair')
corr_heat(cor_matrix)
```
+
+
+
+
Plot some model coefficients. Requires the scico package.
diff --git a/README.md b/README.md
index d4c3d3c..0ff8ba9 100644
--- a/README.md
+++ b/README.md
@@ -101,68 +101,12 @@ create_palette('#ff5500', plot = T)
$tetradic
[1] "#FF5500" "#AAFF00" "#00AAFF" "#5500FF"
-There are some other options to express.
-
-``` r
-create_palette('#ff5500',
- alpha = .5,
- plot = T,
- name = 'orange_you_glad_you_have_this_color')
-```
-
-
-
- $orange_you_glad_you_have_this_color
- [1] "#FF550080"
-
- $complementary
- [1] "#FF550080" "#00AAFF80"
-
- $analogous
- [1] "#FF550080" "#FFD50080" "#FF002B80"
-
- $split_complentary
- [1] "#FF550080" "#00FFD480" "#002BFF80"
-
- $triadic
- [1] "#FF550080" "#00FF5580" "#5500FF80"
-
- $square
- [1] "#FF550080" "#2AFF0080" "#00AAFF80" "#D500FF80"
-
- $tetradic
- [1] "#FF550080" "#AAFF0080" "#00AAFF80" "#5500FF80"
-
One of the built-in palettes is based on R’s blue. Others are based on
[Stan’s](https://github.com/stan-dev/stan) red,
[plotly’s](https://github.com/ropensci/plotly) base colors, and the
red-blue palette from
[RColorBrewer](https://github.com/cran/RColorBrewer/blob/master/R/ColorBrewer.R).
-``` r
-palettes$Rblue
-$Rblue
-[1] "#1f65b7"
-
-$complementary
-[1] "#1f65b7" "#b7701f"
-
-$monochromatic
-[1] "#1f65b7" "#366caa" "#4a719e" "#5a7491"
-
-$analogous
-[1] "#1f65b7" "#241fb7" "#1fb2b7"
-
-$split_complementary
-[1] "#1f65b7" "#b2b71f" "#b7241f"
-
-$triadic
-[1] "#1f65b7" "#66b71f" "#b71f66"
-
-$tetradic
-[1] "#1f65b7" "#b7701f" "#66b71f" "#701fb7"
-```
-
A clean theme for plotly.
``` r
@@ -175,7 +119,7 @@ mtcars %>%
-Visualize a correlation matrix.
+Visualize a correlation matrix via factor analysis.
``` r
data('bfi', package = 'visibly')
@@ -183,7 +127,9 @@ cor_matrix = cor(bfi, use='pair')
corr_heat(cor_matrix)
```
-
+
+
+
Plot some model coefficients. Requires the
scico package.
diff --git a/_pkgdown.yml b/_pkgdown.yml
index b1cf503..46f337c 100644
--- a/_pkgdown.yml
+++ b/_pkgdown.yml
@@ -16,7 +16,7 @@ highlight: pygments
home:
- strip_header: true
+ #strip_header: true
links:
- text: Docs on Stats, R, and more
href: http://m-clark.github.io
@@ -58,6 +58,7 @@ reference:
- plot_gam
- plot_gam_check
- plot_gam_2d
+ - plot_gam_3d
- plot_gam_by
figures:
diff --git a/docs/articles/intro.html b/docs/articles/intro.html
index 92c5e35..05b7aa1 100644
--- a/docs/articles/intro.html
+++ b/docs/articles/intro.html
@@ -94,7 +94,7 @@
vignettes/intro.Rmd
intro.Rmd
The psych package is used to for the factor analysis, which is better suited to survey data and similar settings, where items are of the same type, and you can supply arguments to its fa function. The plot comes from plotly, and hovering over the squares provides the value.
+ +The psych package is used to for the factor analysis, which is better suited to survey data and similar settings, where items are of the same type, and you can supply arguments to its fa function. The plot comes from plotly, and hovering over the squares provides the value.
- -The color scheme is based on the previously mentioned scico package.
+ +The color scheme is based on the previously mentioned scico package.
- -We can see that while there might be the usual ‘Big Five’ personality structure, it may also really just be two underlying constructs- neuroticism vs. the rest, at least for this sample.
+ +We can see that while there might be the usual ‘Big Five’ personality structure, it may also really just be two underlying constructs- neuroticism vs. the rest, at least for this sample.
It occurred to me while updating this functionality that a 3-d approach might actually be useful here (it isn’t the vast majority of the time). When looking at the previous structure in 3-d, we probably would only think about two factors of items.
- - -Note that when you use it, the 3d visualization is interactive, so twist and tilt away!
-There are multiple orderings available to help bring out the structure. This may be particularly useful if you are not dealing with measurement error type data.
- - -Who knew the mtcars data set could actually be interesting!
+ + +There are multiple orderings available to help bring out the structure. This may be particularly useful if you are not dealing with measurement error type data.
+ + +Who knew the mtcars data set could actually be interesting!
A categorical moderator.
-d = gamSim(4)
-Factor `by' variable example
-gam_model = gam(y ~ s(x2, fac, bs='fs'), data=d)
-
-plot_gam_by(gam_model,
- main_var = x2,
- by_var = fac)
In 3d.
+ + +A categorical moderator.
+d = gamSim(4)
+Factor `by' variable example
+gam_model = gam(y ~ s(x2, fac, bs='fs'), data=d)
+
+plot_gam_by(gam_model,
+ main_var = x2,
+ by_var = fac)
3d plot of 2d smooths for generalized additive models.
+ +plot_gam_3d(model, main_var, second_var, conditional_data = NULL, + n_plot = 100, dmb = FALSE, ...)+ +
model | +The mgcv gam model |
+
---|---|
main_var | +The 'x' axis. |
+
second_var | +The 'y' axis' |
+
conditional_data | +Values for other covariates. Default is NULL see +details. |
+
n_plot | +Points to plot. 100 (the default) works well. Embiggen at the +cost of your own waiting time. |
+
dmb | +Whether to use plotly's display mode bar. Default is FALSE. |
+
... | +Arguments for scico |
+
A plotly surface object
+ +This works like plot_gam_2d, the only difference + being that a 3d plot is generated instead. It uses scico for + the palette. It is expected that the two input variables are continuous
+ +Other model visualization: plot_coefficients.brmsfit
,
+ plot_coefficients.lm
,
+ plot_coefficients.merMod
,
+ plot_coefficients
,
+ plot_gam_2d
, plot_gam_check
,
+ plot_gam
+#> Bivariate smoothing example
plot_coefficients.lm
,
plot_coefficients.merMod
,
plot_coefficients
,
- plot_gam_2d
, plot_gam
+ plot_gam_2d
, plot_gam_3d
,
+ plot_gam