You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created the example below for my stats programming college course as a quick , easily comprehensible way to introduce permutation resampling. The error message is very curious. I could find no help by searching stackoverflow, etc. For what it's worth I am a very experienced programmer. I was finally able to fix the problem simply by changing the variable name x to something else. Passing in x in this way causes the error, and any other name instead of x seems to work. My best guess from looking at the error message is that when an x is passed into your functions as below, it somehow gets scope that allows it to interfere with a variable named x that your code uses internally.
Reproducible example
library(tidyverse)
library(infer)
test_table <- tibble(
category = c('A','A','A','A','A','B','B','B','B','B'),
x = 1:10
)
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.
< -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
The problem
I created the example below for my stats programming college course as a quick , easily comprehensible way to introduce permutation resampling. The error message is very curious. I could find no help by searching stackoverflow, etc. For what it's worth I am a very experienced programmer. I was finally able to fix the problem simply by changing the variable name x to something else. Passing in x in this way causes the error, and any other name instead of x seems to work. My best guess from looking at the error message is that when an x is passed into your functions as below, it somehow gets scope that allows it to interfere with a variable named x that your code uses internally.
Reproducible example
library(tidyverse)
library(infer)
test_table <- tibble(
category = c('A','A','A','A','A','B','B','B','B','B'),
x = 1:10
)
test_table %>%
specify(explanatory = category, response = x) %>%
hypothesize(null = "independence") %>%
generate(reps = 5, type = "permute")
The text was updated successfully, but these errors were encountered: