anova_test: Each row of output must be identified by a unique combination of keys

I am trying to run the ANOVA test using this function:

ProportionofCorrectTrials %>% anova_test(data=New,
 formula = ProportionofCorrectTrials ~ Condition*Firsttargetboundary + Error(ID/(Condition*Firsttargetboundary)))

I am being given this response:

Error: Each row of output must be identified by a unique combination of keys.
Keys are shared for 75 rows:

I then tried to changing some of the values to ensure there were none of the same values in more than one column.

I am then getting this error:

df %>% anova_test(data=New,
 formula = ProportionofCorrectTrials ~ Condition*Firsttargetboundary + Error(ID/(Condition*Firsttargetboundary)))

Error: Must subset columns with a valid subscript vector.
x The subscript has the wrong type `data.frame<
c3: double
c4: double
z : double

`.
:information_source: It must be numeric or character.

Would anybody be able to assist?

Here is a snapshot of the dataframe New:

Screenshot 2020-02-27 at 15.07.23

Hello, I hope you don't mind, your code in the post above was preceded by the blockquote marker >
so it wasn't appearing correct. I switched it to backticks ``` for better formatting.

When you use a pipe to pass the data on the left into the function on the right, it must be incorrect to also supply a data param on the function on the right , no ?

anova_test() wants data with unique id's , I think the wid param can be used to make it explicit. Does your data have a concept of unique ID's ? is it the product of making observations, which can be identified in a principled way?

You did share two, errors, that different in their complaint, but with roughly the same code, only with changed data, so if the issues are data related, we will be hardpressed to assist without access to a representative data.
Consider if you can provide a reprex if thinking about the above points doesn't allow your issue to be resolved.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.