vis_NAs: vis_NAs

Description Usage Arguments Value Examples

View source: R/SL_tbl_explore.R

Description

Produce a visualisation of the number of missing values among each student in a regularised SL_tbl.

Usage

1
2
3
4
5
6
7
8
vis_NAs(
  tab,
  response,
  main = paste0("Missing values by student (", attr(tab, "table"), ") (blocks: ",
    paste0(attr(tab, "blocks"), collapse = ", "), ")"),
  show_perc_col = FALSE,
  ...
)

Arguments

tab

A regularised StudentLife tibble (i.e., an object of class reg_SL_tbl) as produced by the function regularise_time.

response

A character string naming one of the columns in tab that is not in attr(tab, "blocks"). If missing then this defaults to the first such column name.

main

The plot title, passed to ggtitle.

show_perc_col

Logical passed to vis_miss. TRUE adds in the percentage of missing data in each column into the x axis.

...

Arguments passed to vis_miss.

Value

A ggplot object.

Examples

1
2
3
4
5
6
7
8
9
d <- tempdir()
download_studentlife(location = d, url = "testdata")

tab_PAM <- load_SL_tibble(schema = "EMA", table = "PAM", location = d)

reg_PAM <- regularise_time(
  tab_PAM, blocks = c("day", "epoch"), m = mean(picture_idx, na.rm = TRUE))

vis_NAs(reg_PAM, response = "m")

studentlife documentation built on Nov. 1, 2020, 9:07 a.m.