Skip to content

Commit c904bc3

Browse files
committed
Workaround for chart$<type>() problem in B07La_pca tutorial
1 parent 7ff9111 commit c904bc3

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: BioDataScience2
2-
Version: 2020.8.1
2+
Version: 2020.8.2
33
Title: A Series of Learnr Documents for Biological Data Science 2
44
Description: Interactive documents using learnr for studying biological data science (second course).
55
Authors@R: c(

NEWS.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# BioDataScience2 News
22

3+
## Changes in version 2020.8.2
4+
5+
- In the B07La_pca tutorial, chart$<type>() does not work properly in specific cases. A work-around is introduced.
6+
7+
38
## Changes in version 2020.8.1
49

5-
- A bug in learnr that cannot start the B07La_pca tutorial.
10+
- In the B07La_pca tutorial, chart$<type>() does not work properly in specific cases. This is an attempt to fix it.
611

712
## Changes in version 2020.8.0
813

inst/tutorials/B07La_pca/B07La_pca.Rmd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,16 @@ chart.pcomp <- function(data, choices = 1L:2L, name = deparse(substitute(data)),
212212
autoplot.pcomp(data, choices = choices, name = name, ..., type = type, env = env)
213213
class(chart.pcomp) <- c("function", "subsettable_type")
214214
215+
# A hack to get fun$type() working in learnr
216+
chart <- list(
217+
screeplot = function(data, type, ...) chart(data, type = "screeplot", ...),
218+
altscreeplot = function(data, type, ...) chart(data, type = "altscreeplot", ...),
219+
loadings = function(data, type, ...) chart(data, type = "loadings", ...),
220+
correlations = function(data, type, ...) chart(data, type = "correlations", ...),
221+
scores = function(data, type, ...) chart(data, type = "scores", ...),
222+
biplot = function(data, type, ...) chart(data, type = "biplot", ...)
223+
)
224+
215225
# Preparation of the dataset ------
216226
penguins <- read("penguins", package = "palmerpenguins", lang = "fr") %>.%
217227
drop_na(., bill_length_mm)

0 commit comments

Comments
 (0)