plot_latent_variables: Plots latent variables

Description Usage Arguments Examples

View source: R/pls_func.R

Description

This function will plot the effects of increasing and decreasing one or several latent variables by the specified standard deviation.

Usage

1
2
plot_latent_variables(plsr_obj, lv_num = 1, sd = 3, FUN = c(barplot,
  barplot), args1 = NULL, args2 = NULL)

Arguments

plsr_obj

A plsr object

lv_num

An integer or list of integer specifying which latent variables to plot.

sd

Range in standard deviations from +[sd] to -[sd].

FUN

A vector containing two functions, which will be used for plotting the results of changes in the latent variable(s) in X and Y. Default is c(barplot,barplot).

args1

Arguments for the plotting function in FUN[1]

args2

Arguments for the plotting function in FUN[2]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
plsr_obj = pls(rating_data, tracking_data,10,10)

#plot latent variable effect with barplots (default) for X and Y side
plot_latent_variables(plsr_obj)

#plot latent variables with barplots for the X side and
#a custom plot function tailored to face tracking data for the Y side
plot_latent_variables(plsr_obj,lv=1:2, sd=2, FUN=c(barplot,plsr:::plot_frame))

#same as above but with additional arguments passed to the plotting functions
plot_latent_variables(plsr_obj,FUN = c(barplot,plsr:::plot_frame),
    args1=list(col="red"),args2 = list(single_frame=5))

plsr documentation built on May 1, 2019, 11:28 p.m.