Skip to content

Commit b34a27d

Browse files
committed
✨ update functions
1 parent f763ed8 commit b34a27d

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

R/utils_sims.R

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,21 @@ generate_seed <- function(seed_list = NULL) {
9797
}
9898

9999
obj <- lapply(obj, function(x) {
100-
error_x <- stats::rnorm(nrow(x), mean = 0, sd = error)
101-
error_y <- stats::rnorm(nrow(x), mean = 0, sd = error)
102-
x[c("x", "y")] <- x[c("x", "y")] + c(error_x, error_y)
103-
return(x) })
100+
101+
x$error_x <- x$error_y <- stats::rnorm(
102+
nrow(x), mean = 0, sd = error)
103+
104+
x$HDOP <- sqrt(2) * sqrt(x$error_x^2 + x$error_y^2) /
105+
sqrt(-2 * log(0.05))
106+
107+
x$original_x <- x$x
108+
x$original_y <- x$y
109+
x[c("x", "y")] <- x[c("x", "y")] + c(x$error_x, x$error_y)
110+
111+
ctmm::uere(x) <- 1
112+
return(x)
113+
114+
}) # end of lapply
104115

105116
return(obj)
106117

0 commit comments

Comments
 (0)