File: formula.R

package info (click to toggle)
r-cran-lavasearch2 2.0.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,832 kB
  • sloc: cpp: 28; sh: 13; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 1,015 bytes parent folder | download
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
27
28
29
30
31
32
33
34
35
### formula.R --- 
##----------------------------------------------------------------------
## Author: Brice Ozenne
## Created: nov 25 2019 (09:39) 
## Version: 
## Last-Updated: Jan 11 2022 (16:43) 
##           By: Brice Ozenne
##     Update #: 14
##----------------------------------------------------------------------
## 
### Commentary: 
## 
### Change Log:
##----------------------------------------------------------------------
## 
### Code:

formula.varStruct <- function(x, ...){
    return(attr(x, "formula"))
}
formula.corStruct <- function(x, ...){
    return(attr(x, "formula"))
}
formula.reStruct <- function(x, ...){
    n.random <- length(x)
    group.random <- names(x)
    ls.formula <- lapply(1:n.random, function(iN){ ## iN <- names(x)[1]
        stats::as.formula(paste0(deparse(attr(x[[iN]],"formula")),"|", group.random[iN]))
    })
    return(ls.formula)
}


######################################################################
### formula.R ends here