Skip to content

Commit cfd5d02

Browse files
committed
styler
1 parent dc1b6db commit cfd5d02

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/testthat/test-r2_nagelkerke.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ test_that("r2_nagelkerke, multinom, correct base-model with NA", {
2323
skip_if_not_installed("nnet")
2424

2525
n_obs <- 1000
26-
softmax <- function(x){
26+
softmax <- function(x) {
2727
exp(x - max(x)) / sum(exp(x - max(x)))
2828
}
29-
sample_y <- function(x){
29+
sample_y <- function(x) {
3030
sample(1:3, size = 1, prob = softmax(c(0.25 * x, -0.1 * x, 0 * x)))
3131
}
3232
set.seed(123)
3333
sim_df <- data.frame(x = rnorm(n_obs, 0, 1), y = NA)
3434

35-
for(i in 1:nrow(sim_df)){
35+
for (i in 1:nrow(sim_df)) {
3636
sim_df$y[i] <- sample_y(sim_df$x[i])
3737
}
3838

3939
sim_df$x[1:500] <- NA
40-
sim_df2 <- sim_df[!is.na(sim_df$x),]
40+
sim_df2 <- sim_df[!is.na(sim_df$x), ]
4141

4242
m1 <- nnet::multinom(y ~ x, data = sim_df, trace = FALSE)
4343
m2 <- nnet::multinom(y ~ x, data = sim_df2, trace = FALSE)

0 commit comments

Comments
 (0)