vis_NAs {studentlife}R Documentation

vis_NAs

Description

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

Usage

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

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")


[Package studentlife version 1.1.0 Index]