File: response.R

package info (click to toggle)
r-cran-spatstat.core 2.4-4-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,440 kB
  • sloc: ansic: 4,402; sh: 13; makefile: 5
file content (28 lines) | stat: -rw-r--r-- 615 bytes parent folder | download | duplicates (2)
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
#'
#'   response.R
#'
#'   Extract the values of the response, from a fitted model
#' 
#'

response <- function(object) {
  UseMethod("response")
}

response.glm <- response.lm <- function(object) {
  mo <- object$model
  if(is.null(mo)) return(NULL)
  te <- terms(object)
  rn <- attr(te, "response")
  if(is.null(rn)) return(NULL)
  y <- mo[,rn]
  return(y)
}

response.ppm <- function(object) { data.ppm(object) }

response.dppm <- response.kppm <- function(object) { data.ppm(as.ppm(object)) }

response.slrm <- function(object) { object$Data$response }

response.mppm <- function(object) { data.mppm(object) }