plot_time_trend: Plot time trend

Description Usage Arguments Examples

View source: R/plots.R

Description

Plot time trend

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
plot_time_trend(
  data,
  variables,
  time_variable,
  filter_value = 1,
  title = NULL,
  xlab = NULL,
  ylab = NULL,
  var_names = NULL,
  max_value = 100,
  color = 0.5,
  return = c("data", "plot")
)

Arguments

data

Data object

variables

which variables do you want to see

time_variable

choose between month or wave

filter_value

which value of response e.g. 1 - most of the time

title

specify title

xlab

specify xlab

ylab

specify ylab

var_names

to relabel the header on the plot

max_value

adjust the y axis

color

change the color, available range = 0-1

return

do you want to get data or plot – I like this to

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
plot_time_trend(data = iCARE,
                variables = c(impacvd_sq003, impacvd_sq001, impacvd_sq002),
                filter_value = 1,
                time_variable = wave, # test out for month if you wish
                var_names = c("impacvd_sq003" = "Depression",
                              "impacvd_sq001" = "Anxiety",
                              "impacvd_sq002" = "Loneliness"),
                max_value = 25,
                title = "Trend over waves of survey",
                return = "plot")

kosirurska/iCAREstudy documentation built on Dec. 21, 2021, 7:44 a.m.