File: princomp.R

package info (click to toggle)
r-cran-semplot 1.1.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 464 kB
  • sloc: makefile: 2
file content (26 lines) | stat: -rw-r--r-- 529 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# semPaths.princomp <- function(object,...) 
# {
#   invisible(semPaths(semPlotModel(object),...))
# }
# 


### SINGLE GROUP MODEL ###
semPlotModel.princomp <- function(object, ...)
{
  
  # Check if object is of class "sem":
  if (!"princomp"%in%class(object)) stop("Input must be a 'princomp' object")
  
  
  # Extract model:
  mod <- semPlotModel(loadings(object))
  manNames <- mod@Vars$name[mod@Vars$manifest]
  
  # Fix:
  mod@Pars[c("lhs","rhs")] <- mod@Pars[c("rhs","lhs")]
  mod@Pars$edge <- "->"
    
  return(mod)
}