Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings in data_summary() with by? #583

Open
strengejacke opened this issue Jan 12, 2025 · 1 comment
Open

Warnings in data_summary() with by? #583

strengejacke opened this issue Jan 12, 2025 · 1 comment

Comments

@strengejacke
Copy link
Member

Not sure if grouping is the problem here, but there shouldn't be warnings.

library(datawizard)
library(rtdists)
data <- rtdists::speed_acc |>
  data_filter(rt < 1.5 & stim_cat == "word" & frequency == "low")

data <- data_modify(
  data,
  error = ifelse(as.character(response) != as.character(stim_cat), 1, 0)
)
data_rt <- data_filter(data, error == 0)
data_sub <- aggregate(rt ~ id + condition, data_rt, mean)
data_summary(data_rt, rt = mean(rt), by = c("id", "condition"))
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> Warning in mean.default(rt): argument is not numeric or logical: returning NA
#> id | condition |   rt
#> ---------------------
#> 1  |  accuracy | 0.59
#> 1  |     speed | 0.54
#> 2  |  accuracy | 0.77
#> 2  |     speed | 0.60
#> 3  |  accuracy | 0.72
#> 3  |     speed | 0.54
#> 4  |  accuracy | 0.56
#> 4  |     speed | 0.48
#> 5  |  accuracy | 0.64
#> 5  |     speed | 0.48
#> 6  |  accuracy | 0.62
#> 6  |     speed | 0.48
#> 7  |  accuracy | 0.59
#> 7  |     speed | 0.55
#> 8  |  accuracy | 0.91
#> 8  |     speed | 0.56
#> 9  |  accuracy | 0.72
#> 9  |     speed | 0.54
#> 10 |  accuracy | 0.59
#> 10 |     speed | 0.50
#> 11 |  accuracy | 0.60
#> 11 |     speed | 0.52
#> 12 |  accuracy | 0.69
#> 12 |     speed | 0.54
#> 13 |  accuracy | 0.77
#> 13 |     speed | 0.56
#> 14 |  accuracy | 0.72
#> 14 |     speed | 0.53
#> 15 |  accuracy | 0.78
#> 15 |     speed | 0.56
#> 16 |  accuracy | 0.73
#> 16 |     speed | 0.57
#> 17 |  accuracy | 0.75
#> 17 |     speed | 0.54

warnings()

Created on 2025-01-12 with reprex v2.1.1

@mattansb
Copy link
Member

Looks like it's confused by the rt() function - confusing the global environment with the data environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants